我想有这种查询雄辩:如何结合WHERE子句中雄辩
SELECT * FROM table WHERE status = 1 AND (type = 2 OR type = 3 OR type = 4)
我一直没能找到雄辩这样做的一个简单的方法。如果我使用
Table::where('status', 1)->orWhere('type', 2)->orWhere('type', 3)...
这这相当于:
SELECT * FROM table WHERE status = 1 OR type = 2 OR type = 3 OR type = 4
这不是我所需要的。为'status = 1'创建一个查询范围也会得到相同的结果。我如何在Eloquent中运行这个查询?