Yii Framework Forum: Sum or Count data in DataProvider - Yii Framework Forum

Jump to content

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

Sum or Count data in DataProvider Rate Topic: -----

#1 User is offline   bungkhan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 30-January 11
  • Location:Thailand

Posted 27 March 2011 - 09:27 PM

i have salary data in DataProvider .
i want to reuse or modify data in DataProvider.
(Sum, count, average ...)

Thank you.
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 28 March 2011 - 02:13 AM

Set the property select of criteria in dataprovider:

In the function search add:

return new CActiveDataProvider('model', array(
    'criteria'=>array('select'=>'salary, ....')
));

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