I have a page using standard grid using ActiveDataProvider I need extract in controller the query of ActiveDataProvider. I need to create a new query from the filter results of ActiveDataProvider.
Ex:
$searchModel = new AcaoSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
//NEW QUERY
$newQuery = clone $dataProvider->query;
//I need something …
$newQuery->joinWith([‘xxxxx’]);// example - join with does not work in this example
$newQuery->asArray->all(); //example - as array does not work in this example