public function actionIndex() { $dataProvider = new CActiveDataProvider('Players', array('criteria' => array('select' => '`id`, `nick`, `steam_id`, `last_seen`, ' . Players::sql_skill_formula() . ' AS `skill`', 'order' => '`skill` DESC, `id` ASC', 'condition' => 'last_seen > ' . (time() - 60 * 60 * 24 * 7)), 'pagination' => array('pageSize' => Yii::app()->config->bans_per_page))); $model = new Players('search'); $model->unsetAttributes(); if (isset($_GET['Players'])) { $model->attributes = $_GET['Players']; } $this->render('index', array('dataProvider' => $dataProvider, 'model' => $model)); }