group by in yii2 grid view

(Arunwebber) #1

Hi, I have a table which is counting impressions views and clicks of particular videos.

Goes this way.


Now i want to show in impression column total number of clicks for a particular ad id and the impressions should not be counted if the impression is coming from the same IP. How can I do that in grid view? Ip I am counting in user_ip column which is commented out in the grid view.

Publisher id doesn’t matter the query which I am using in grid view is as follows.

'dataProvider'=>new ActiveDataProvider([

            'query' => Adanalytics::find()->

                  where(['publisher_id' =>  Yii::$app->user->identity->id ]),


(Arunwebber) #2

This is solved the issue