在controller下写了两个查询,但是第二个不能实现

浏览:718 发布日期:2015/09/28 分类:求助交流
模版index下需要两个查询
public function index(){
$news = M('News');
$map = array(
'flag' => 1,
'head' => 1,
);
$this ->assign('data',$news->where($map)->where("imgpath<>''")->order('date DESC')->limit(1)->find());
$this ->assign('list',$news->where("flag = 1 and head = 0")->order('date DESC')->select());
$this ->display();
}
第一个实现普通查询,第二个实现遍历,但是这样做第二个不能实现。新人小白求助我那儿出问题了?求大神解答或者给建议
最佳答案
评论( 相关
后面还有条评论,点击查看>>