标签:etc ssi where color order ret post 存在 page
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‘);
标签:etc ssi where color order ret post 存在 page
原文地址:https://www.cnblogs.com/ssx314/p/10014236.html