Ciao ragazzi sto usando codice seguente e l'opera limit
doesnt, ma se vedo il comando di quello che mostra limit
in questo, ma quando passo la query per ActiveDataProvider
è recuperare tutti i recordLIMIT non funziona in ActiveDataProvider
$data= User::find()->where(['category_id'=> 5])->orderBy(['rand()' => SORT_DESC])->limit(4);
$command = $data->createCommand();
$data2 = $command->queryAll();// This works fine and fetch only 4 data
$dataProvider = new ActiveDataProvider([
'query' => $data,
]); // But this displays all data without limit
Cosa c'è che non sto facendo qui ???