Laravel whereIn OR WhereIn
2022-08-30 12:48:11
我正在通过过滤器进行产品搜索:
我的代码:
->where(function($query) use($filter)
{
if(!empty($filter)){
foreach ($filter as $key => $value) {
$f = explode(",", $value);
$query-> whereIn('products.value', $f);
}
}
})
查询:
and (products.value in (Bomann, PHILIPS) and products.value in (red,white))
但我需要:
and (products.value in (Bomann, PHILIPS) OR products.value in (red,white))
在Laravel中是否有类似的东西:
orWhereIn