Yii Framework Forum: group by in yii2 grid view - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

group by in yii2 grid view How to work with group view in yii2

#1 User is offline   arunwebber 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 23-November 16

Posted 16 April 2018 - 07:33 AM

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

Goes this way.
[attacIment=7650:Selection_119.png]

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 ]),
        ]),

Attached File(s)


This post has been edited by arunwebber: 16 April 2018 - 11:15 PM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users