php where条件消失 有人知道为什么吗

Posted ssx314

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php where条件消失 有人知道为什么吗相关的知识,希望对你有一定的参考价值。

 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条件消失 有人知道为什么吗的主要内容,如果未能解决你的问题,请参考以下文章

phpmyadmin index.php 文件消失

Laravel 4:将 where 子句添加到连接条件

我可以做 Model->where('id', ARRAY) 多个 where 条件吗?

PHP 语法 ??意思,有人能解释一下吗? [复制]

PHP:转义 RegEx 保留的字符 - 有人知道这有啥问题吗?

有人知道任何好的 PHP Codeigniter 自动表单生成器吗? [关闭]