Пример #1
0
 /**
  * 修改超级管理员
  * @author wonguohui
  * @Date   2016-01-06T22:21:34+0800
  */
 public function actionStatus()
 {
     $id = Yii::$app->request->get('id');
     $model = new \backend\models\Admins();
     $res = $model->chageStatus($id);
     if ($res) {
         return $this->redirect(['admins/index']);
     }
 }
Пример #2
0
 /**
  * Finds the Admins model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Admins the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Admins::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }