thinkphp6 另一种where判断写法

 

记录一下这种判断写法

$sqlModel = Db::name('news');
$sqlModel = $sqlModel->where('endtime','>=',time());
$sqlModel = $sqlModel->where('begintime','<=',time());
$sqlModel = $sqlModel->where('endtime','>=',time());
$sqlModel = $sqlModel->whereRaw("FIND_IN_SET('{$companyinfo['tradeid']}', tradeid)"); $sqlModel = $sqlModel->where('province','in',$province.',不限');
$list = $sqlModel ->fetchSql(false) ->paginate(['list_rows'=>20,'query' => request()->param()]);

 

posted @ 2021-11-10 16:43  赵瑛  阅读(608)  评论(0编辑  收藏  举报

版权所有 © 2022 沅来是澧

如果有程序开发、网站建设等需求的请联系我,QQ:47419233