1. 程式人生 > >php where條件消失 有人知道為什麽嗎

php where條件消失 有人知道為什麽嗎

per elseif all sign nlog 消失 span ssi type

 1 $perPage = 20;
 2         $curPage = 1;
 3 
 4         $k2 = ‘‘;
 5         $list = AdminLogModel::where(‘id‘, ‘>‘, ‘0‘);
 6         if(input(‘?post.k2‘) || input(‘?get.k2‘)) {
 7             $k2 = input(‘k2‘);
 8             if($k2!=‘‘){$list = $list->where(‘log_type‘, ‘=‘ , $k2);}
 9         }
10 $list->count();//此條存在後面查詢就不帶where條件,刪除就可以 11 $list = $list->order(‘id‘, ‘desc‘)->paginate($perPage);//這裏查詢不帶where條件(‘log_type‘,‘=‘,$k2); 12 $allPage = $list->lastPage(); 13 $this->assign(‘list‘,$list); 14 $this->assign(‘count‘,$list->count());
15 16 if(input(‘?get.page‘)){ 17 $curPage = input(‘get.page‘); 18 if($curPage < 1){ 19 $curPage = 1; 20 } 21 elseif ($curPage > $allPage){ 22 $curPage = $allPage; 23 } 24 } 25 $this
->assign(‘curPage‘, $curPage); 26 $this->assign(‘allPage‘, $allPage); 27 $this->assign(‘k2‘, $k2); 28 return $this->fetch(‘/admin_log‘);

php where條件消失 有人知道為什麽嗎