
正文
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];
});






