laravel whereIn multiple columns

谁说我不能喝 提交于 2019-12-11 05:38:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!