laravel whereIn 多列

2021-12-26 00:00:00 php laravel eloquent where-in

我正在为此查询寻找 Laravel 方式:

I am looking for laravel way for this query:

select * from `table` 
where (product_id, request_id) NOT IN ((66, 10),(76,23))

也许是这样的:

$ids = =array(
    ['66', '10'],
    ['76', '23']
)
DB::table('table')->whereNotInMultiple(['product_id', 'request_id'], $ids)->get();

我如何在 Laravel 中做到这一点?

How do I do this in laravel?

推荐答案

DB::table('table')->whereNotIn('product_id', ['66','10'])
->whereNotIn('request_id', ['76', '23'])->get();

相关文章