作者:fgsZHdgsz | 来源:互联网 | 2023-08-30 11:40
Howtoperformawhereclauseusinglaraveleloquentwiththefollowingquery:如何使用以下查询使用laravelelo
How to perform a where clause using laravel eloquent with the following query:
如何使用以下查询使用laravel eloquent执行where子句:
select * from stats where payed = 1 AND WHERE (user_id = 1 OR owner_id = 1)
I don't know how to modify this code for this:
我不知道如何为此修改此代码:
$payouts = Stat::where('payed', '1')
->???(function ($query) {
$query->where('owner_id', Auth::user()->id)
->where('user_id', Auth::user()->id);
})->get();
3 个解决方案