public function actionGraduate() { $roles = ['1', '5', '3', '2']; $role = \Yii::app()->user->role; if (array_intersect($role, $roles)) { $model = new Listner('search'); $model->unsetAttributes(); // clear any default values $model->status = Listner::STATUS_GRADUATE; if (Yii::app()->getRequest()->getParam('Listner') !== null) { $model->setAttributes(Yii::app()->getRequest()->getParam('Listner')); } if (array_intersect($role, [2, 3])) { $model->branch_id = \Yii::app()->user->branch; } $model->is_test = 0; $this->render('graduate', ['model' => $model]); } else { throw new CHttpException(403, 'Ошибка прав доступа.'); } }
/** * Управление Студентами. * * @return void */ public function actionIndex() { $model = new Listner('search'); $model->unsetAttributes(); // clear any default values if (Yii::app()->getRequest()->getParam('Listner') !== null) { $model->setAttributes(Yii::app()->getRequest()->getParam('Listner')); } $this->render('index', ['model' => $model]); }