如何在带背包的laravel中添加IN
子句?
这就是我要寻找的:
$this->crud->addClause('where', 'customer_id', 'in', [1,3,5,6,7]);`
应该翻译成这样:
select * from customer where customer_id in (1,3,5,6,7);
答案 0 :(得分:1)
只需使用whereIn
而不是where
, backpack-for-laravel
即可:
$this->crud->addClause('whereIn', 'customer_id', [1,3,5,6,7]);
答案 1 :(得分:0)
从客户中选择* whereIn(customer_id,$ array);