//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%' )");
点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部