everyone this is my function that return the data provider to the gridview.
public function search($params)
{
$query = EventOrganizer::find()
->where(['event.approve' => 0])
->groupBy(['event.eventID']);
// add conditions that should always apply here
$query ->joinWith(['event', 'organizer']);
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
$query->select(['event.eventID','event.title','event.startDate','event.startTime','event.endDate','event.endTime',
'event.photo','event.description','event.location','event.approve',
"GROUP_CONCAT(CONCAT(`organizer`.`name`,\" \", `organizer`.`organizerID`)) AS Name"])
->andFilterWhere(['like', 'event.eventID', $this->eventID])
->andFilterWhere(['like', 'organizer.organizerID', $this->organizerID]);
return $dataProvider;
}
The following is part of my code in gridview. When i trying to access data inside the data provider, I couldnt get to access the column which i had using group_concat.
[
'label'=> 'End Time',
'attribute' => 'GROUP_CONCAT(CONCAT(`organizer`.`name`,\" \", `organizer`.`organizerID`)) AS Name',
],
I was able to access the other data as follow:
[
'label'=> 'End Date',
'attribute' => 'event.endDate',
],
this prove that my data provider contains data, I have try a couple of ways but i still couldn't get to access on it. Can anyone help me on this?