Hi everybody!
I have used 2 query syntax following:
$q = Product::find()->where([‘name’=>$name])->all();
$dataProvider = new ActiveDataProvider([‘query’ => $q]);
$q = new yii\db\Query();
$q->select(’*’)->from(‘product’)->where([‘name’=>$name])->all();
$dataProvider = new ActiveDataProvider([‘query’ => $q]);
Both have the same goal get data from ‘product’ table by ‘name’ and diplay out Gridview, 1. gives the result well, but 2. gives the result NULL.
Anybody have any ideas?Thanks.