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);
       });
};

 使用闭包查询

原文地址:https://www.cnblogs.com/pcx105/p/13826198.html