我想将此原始sql转换为雄辩的
SELECT x.* from
(SELECT * from clients where office_id IN(74,129,19)) AS x
where
x.firstname like '%parker%' or
x.lastname like '%parker%'
我的模特是Client
答案 0 :(得分:0)
好吧,我使用
找到了答案use Illuminate\Database\Eloquent\Builder;
$office_ids = [74,129,19];
Client::with('office')->whereIn('office_id',$office_ids)->where(function(Builder $dbQuery){
....
})