tp5.1 模型 where多条件查询 like 查询


来源:https://blog.csdn.net/qq_41241684/article/details/87866416

所以我改成这样:

$paperTypeModel = new PaperType();
        $seach = Request::get('seach');
        $where = array();
        if (!empty($seach))
        {
            $where[] = ['name', 'like', '%'.$seach."%"];
        }
        $list = $paperTypeModel::where($where) -> where(['if_delete'=>1])
                                ->paginate(15)-> each(function ($item, $key){
                $item->statusName = $this->status[$item->status];
        });

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM