tp5 where a and (b or c)

$where = function ($query) use ($map1, $map2) {
      $query->whereOr(function ($query) use ($map1) {
           $query->where($map1);
      })->whereOr(function ($query) use ($map2) {
            $query->where($map2);
       });
};

 使用闭包查询

posted @ 2020-10-16 14:10  pengcx  阅读(310)  评论(0编辑  收藏  举报