laravel whereIn 多列 [英] laravel whereIn multiple columns

查看:39
本文介绍了laravel whereIn 多列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为此查询寻找 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();

这篇关于laravel whereIn 多列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆