<?php
/**
 * 每天广告汇总数据
 * @author yzxh24
 */
class SumAction extends BaseAction
{
    public function run()
    {
        $criteria = $this->_buildCriteria(new CDbCriteria());
        $dataProvider = new CActiveDataProvider('AdFluxSum',array(
        	'pagination' => array(
        		'pageSize' => 20
        	),
        	'sort' => array(
        		'defaultOrder' => 'id DESC',
        	),
        ));
        $dataProvider->setCriteria($criteria);
        
		$this->getController()->render('sum', array(
			'dataProvider' => $dataProvider,
		));
    }
    
    /**
     * 根据url后面传递进来的参数获取一个查询条件
     * @param CDbCriteria $criteria
     * @return CDbCriteria
     */
    private function _buildCriteria(CDbCriteria $criteria)
    {
    	// 完善此功能
    	return Helper::buildCriteria($criteria, $_GET);
    }
}