<?php
/**
 * Created by JetBrains PhpStorm.
 * User: yzxh24
 * Date: 11-11-7
 * Time: 下午3:43
 * To change this template use File | Settings | File Templates.
 */
class ResponeAction extends BaseAction
{
    public function run()
    {
    	$criteria = $this->_buildCriteria(new CDbCriteria(array('with'=>'task')));
        //put your code here
        $dataProvider = new CActiveDataProvider('TaskRespone',array(
        	'pagination' => array(
        		'pageSize' => 20
        	),
        	'sort' => array(
        		'defaultOrder' => 't.id DESC',
        	),
        ));
        $dataProvider->setCriteria($criteria);

        $this->getController()->addBreadcrumb(array('参加列表'=>array('/admin/tasker/list')));
		$this->getController()->render('respone', array(
			'dataProvider' => $dataProvider,
		));
    }

    /**
     * 根据url后面传递进来的参数获取一个查询条件
     * @param CDbCriteria $criteria
     * @return CDbCriteria
     */
    private function _buildCriteria(CDbCriteria $criteria)
    {
    	// 完善此功能
    	return Helper::buildCriteria($criteria, $_GET);
    }
}
