<div class="cnblogs_code">
assign('title','news');
$p = I('page',1);
$listRows = 6;
$News = M('news');
$info = $News->field('id,title,subtitle,publish_date,img,detail,typename')->where(array('type'=>'news','status'=>'1'))->order('flag desc,sort_no desc')->page($p,$listRows)->select();
if(!empty($info)){
foreach($info as $k=>$v){
$info[$k]['detail']=mb_substr($v['detail'],130,'utf-8');
}
}
$this->assign('news',$info);
$count = $News->where(array('type'=>'news','status'=>'1'))->count();
$Page = new Page($count,$listRows);
$show = $Page->show();
$this->assign('page',$show);
$this->display();
}