Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的查询:
return parent::whereIn('user_id', $users)->orWhere("user_id", $user->id)->get();
它只运行第一个 whereIn 查询并忽略 orWhere 查询。
谢谢!
你应该试试这个:
return parent::where("user_id", $user->id)->orWhereIn('user_id', $users)->get();
你能试试这个吗?
parent::whereIn('user_id', $users)->where(function ($query) { $query->orWhere("user_id", $user->id); })->get();