I have following code of index action
$searchModel = new PatientTestSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
Search function in patientTestSearch is
$query = PatientTest::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => ['pageSize' => $pagination],
'sort' => ['defaultOrder' => ['created_at' => SORT_DESC]]
]);
$query->joinWith('patient');
$query->joinWith('testGroup');
how to use group concate and group by in above query? i have tried this in controller's action
$dataProvider->query->groupBy(['patient_id']);
but this gives following error
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'wizlaboratory.patient_test.patient_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
If i use sqldataprovider then i cant have filtering option.