Beispiel #1
0
 public function getIndexData()
 {
     $criteria = new CDbCriteria();
     $today = DateTimeHelper::today();
     $criteria->mergeWith(array('condition' => 'event_date>=:event_date', 'params' => array(':event_date' => $today)));
     /*
      * There may be some problem with the yii's model relation
      * although it is tested that it works locally
      * but it wont work properly on the server
      * dont know why
      */
     //$criteria->with = array('GroupProductsCount','JoinedGroups');
     //$criteria->together = true;
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => '`t`.event_date ASC'), 'pagination' => array('pageSize' => 10)));
 }