You can do this:
$query = ModelName::find()->where(['parentId' => $arr]); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]);
When you pass an array to where , Yii automatically converts it to an IN condition.
Thus, the formed conditional part of SQL will be WHERE parentId IN (1, 2, 4, 6); .
This is equivalent to the specified condition with OR .
arogachev
source share