84669 人が学習中
152542 人が学習中
20005 人が学習中
5487 人が学習中
7821 人が学習中
359900 人が学習中
3350 人が学習中
180660 人が学習中
48569 人が学習中
18603 人が学習中
40936 人が学習中
1549 人が学習中
1183 人が学習中
32909 人が学習中
なぜ教師が直接記述して使用できるのでしょうか? テストしたところ、すべてが表示されました。ページング条件は直接無視されました。SQL を印刷すると、ページング条件がないことが表示されました。
そのコードの位置を変更するだけです:
public functionindex(){ //カテゴリ情報表示 $cateId=Request::param('cate_id');を使用する 使用する を使用する を使用する を使用するthrough using through through through through through through through through through over over over through over over''''-'''''-'- ‐ であると考えられる isset($cateId)){ $res=ArtCate::get($cateId); $this->view->assign('cateName',$res->name); $artList=Db ::name('zh_article') (3); $this->view-> ;assign('artList',$artList); } else{ $artList=Db::name('zh_article' ) - ->where('status ', 1) &-& gt; Order (' Create_time ',' Desc ')-& GT; assign (' cateneme ',' すべての記事'); } $this->view->assign('artList',$artList); $this->fetch();}
抱歉,应该是这样的:
if (isset($cateId)){ $artList=Db::table('zh_article') ->where('status',1) ->where ('cate_id',$cateId) ->order('create_time','desc')->paginate(3);}$artList=Db::table('zh_article') - >where('status',1) ->where('cate_id',$cateId) ->order('create_time','desc')->paginate(3);$this ->view->assign('artList',$artList); return $this->fetch();
if (isset($cateId)){ $artList=Db::table('zh_article') ->where('status',1) ->where('cate_id',$cateId) ->order('create_time','desc')->paginate(3);}$artList=Db::table('zh_article') ->where('status',1 ) ->order('create_time','desc')->paginate(3);$this->view->assign('artList',$artList); return $ this->fetch();
この子は出来ます
同じ質問
そのコードの位置を変更するだけです:
public functionindex()
{
//カテゴリ情報表示
$cateId=Request::param('cate_id');
を使用する 使用する を使用する を使用する を使用するthrough using through through through through through through through through through over over over through over over''''-'''''-'- ‐ であると考えられる
isset($cateId)){
$res=ArtCate::get($cateId);
$this->view->assign('cateName',$res->name);
$artList=Db ::name('zh_article')
(3);
$this->view-> ;assign('artList',$artList);
}
else{
$artList=Db::name('zh_article' )
- ->where('status ', 1) &-& gt; Order (' Create_time ',' Desc ')-& GT; assign (' cateneme ',' すべての記事');
}
$this->view->assign('artList',$artList);
$this->fetch();
}
抱歉,应该是这样的:
if (isset($cateId))
{
$artList=Db::table('zh_article')
->where('status',1)
->where ('cate_id',$cateId)
->order('create_time','desc')->paginate(3);
}
$artList=Db::table('zh_article')
- >where('status',1)
->where('cate_id',$cateId)
->order('create_time','desc')->paginate(3);
$this ->view->assign('artList',$artList);
return $this->fetch();
if (isset($cateId))
{
$artList=Db::table('zh_article')
->where('status',1)
->where('cate_id',$cateId)
->order('create_time','desc')->paginate(3);
}
$artList=Db::table('zh_article')
->where('status',1 )
->order('create_time','desc')->paginate(3);
$this->view->assign('artList',$artList);
return $ this->fetch();
この子は出来ます
同じ質問