//whereOr
$where1 = [
'is_job'=>1,
'project_ids'=>['like','%'.$project_id.',%'],
];
$where2 = [
'is_job'=>1,
'project_ids'=>['like','%,'.$project_id.'%'],
];
$list = Db::table('show_user')->whereOr([ $where1, $where2 ])->select();
//原生语句则是
$list = Db::query("SELECT * FROM `show_user` WHERE ( `is_job` = '1' AND `project_ids` LIKE '%$project_id,%' ) OR ( `is_job` = '1' AND `project_ids` LIKE '%,$project_id%' )");
发表评论 取消回复