$restaurants->find()->where(['id' => $r_ids])->all();
$r_ids是我在查询中需要的ID数组,但这不能按预期工作.
$restaurants->find()->where(['id' => $r_ids])->all();
$r_ids是我在查询中需要的ID数组,但这不能按预期工作.
$query = $articles ->find() ->where(['id' => $ids],['id' => 'integer[]']);
或明确地使用IN关键字:
$query = $articles ->find() ->where(['id IN' => $ids]);
也可以看看
> Cookbook > Database Access & ORM > Query Builder > Automatically Creating IN Clauses