Loading... <div class="tip inlineBlock share"> $this ->alias('a') ->field('a.*,b.title as category_name,c.nickname') ->join("__CATEGORY__ b","a.category = b.id","LEFT") ->join("__ADMIN__ c","a.deal_user_id = c.userid","LEFT") ->order(array('a.id' => 'DESC')) ->where([$map]) ->where(function ($q) use($_string) { $q->whereOr($_string); }) ->page($page, $limit) ->select(); </div> $_string[]=["a.deal_user_id","=",$userid]; $_string[]=["a.user_id","=",$userid]; $_string[]=['','exp',Db::raw("FIND_IN_SET($userid,a.cc)")]; 最后修改:2020 年 08 月 06 日 10 : 19 AM © 允许规范转载 赞赏 随便看看就好,打赏个一毛两毛也不错 赞赏作者 支付宝微信
1 条评论
在where中用【】包裹一个条件数组,会使当前条件在sql中被()包裹,以达到条件分组的效果,如果想在一个分组里使用or来连接所有条件就可以用上文中的例子,在wehre()中写一个函数来添加条件(ノ°ο°)ノ