如何在laravelbackpack中指定in子句?

p5cysglq  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(338)

如何添加 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);
a7qyws3x

a7qyws3x1#

选择*from customer where(customer\u id,$array);

ukxgm1gy

ukxgm1gy2#

只是使用 whereIn 而不是 where , backpack-for-laravel 准备好了:

$this->crud->addClause('whereIn', 'customer_id', [1,3,5,6,7]);

相关问题