问题
I am looking for laravel way for this query:
select * from `table`
where (product_id, request_id) NOT IN ((66, 10),(76,23))
Perhaps something like:
$ids = =array(
['66', '10'],
['76', '23']
)
DB::table('table')->whereNotInMultiple(['product_id', 'request_id'], $ids)->get();
How do I do this in laravel?
回答1:
DB::table('table')->whereNotIn('product_id', ['66','10'])
->whereNotIn('request_id', ['76', '23'])->get();
来源:https://stackoverflow.com/questions/56735665/laravel-wherein-multiple-columns