/**
  * 用户登录
  */
 public function actionLogin()
 {
     if (!Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new LoginForm();
     $model->userClass = Admin::className();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->goHome();
     } else {
         return $this->renderPartial('login', ['model' => $model]);
     }
 }
Beispiel #2
0
 public function getAdmin()
 {
     return $this->hasOne(Admin::className(), ['id' => 'admin_id']);
 }
Beispiel #3
0
 public function getHandler()
 {
     return $this->hasOne(Admin::className(), ['id' => 'handle_uid']);
 }
Beispiel #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCreatedBy0()
 {
     return $this->hasOne(Admin::className(), ['id' => 'createdBy']);
 }
Beispiel #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAdmins()
 {
     return $this->hasMany(Admin::className(), ['roleId' => 'RoleId']);
 }