如果我有这个数组的输出:
$array_to_delete =
[
(int) 3 => (int) 4,
(int) 4 => (int) 5
]
我希望得到4和5等等在哪里条件,就像那样:
$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
->where(['id', $array_to_delete])
->all();
我该怎么做?在蛋糕PHP
答案 0 :(得分:1)
使用IN
$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
->where(['id IN', $array_to_delete])
->all();