很多情况下会用到复合查询:
代码语言:javascript复制 $query->orWhere('target_type','offline');
$query->where(function($query){
$query->where('use',1)->orWhere(function($query){
$query->where('use',0)
->where('expire_time','>',time())->orWhere('expire_time',0);
});
});