<?php
/**
 * 每日流量汇总
 * @author yzxh24
 */
class FluxSumAction extends BaseAction
{
    public function run()
    {
        $criteria = $this->_buildCriteria(new CDbCriteria());
        $dataProvider = new CActiveDataProvider('FluxSum',array('pagination' => array('pageSize' => 31), 'sort' => array('defaultOrder' => 'date DESC')));
        $dataProvider->setCriteria($criteria);
        
        $dataSum = FluxSum::dataSum($criteria);
        $this->getController()->render('fluxsum', array(
			'dataProvider' => $dataProvider,
            'dataSum' => $dataSum,
		));
    }
    
    private function _buildCriteria(CDbCriteria $criteria)
    {
        return Helper::buildCriteria($criteria, $_GET);
    }
}