コード例 #1
0
ファイル: UserController.php プロジェクト: hehekeke/mir_web
 /**
  * 审核
  * @author wonguohui
  * @Date   2016-01-06T20:54:25+0800
  */
 public function actionStatus()
 {
     $id = Yii::$app->request->get('id');
     $model = new \backend\models\MirUser();
     $res = $model->chageStatus($id);
     if ($res) {
         return $this->redirect(['user/index']);
     }
 }
コード例 #2
0
ファイル: MirUserSearch.php プロジェクト: hehekeke/mir_web
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = MirUser::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['user_id' => $this->user_id, 'user_chk' => $this->user_chk, 'user_date' => $this->user_date]);
     $query->andFilterWhere(['like', 'user_name', $this->user_name])->andFilterWhere(['like', 'user_pwd', $this->user_pwd])->andFilterWhere(['like', 'user_class', $this->user_class])->andFilterWhere(['like', 'user_tel', $this->user_tel])->andFilterWhere(['like', 'user_email', $this->user_email])->andFilterWhere(['like', 'user_place', $this->user_place])->andFilterWhere(['like', 'user_xm', $this->user_xm])->andFilterWhere(['like', 'user_com', $this->user_com])->orderBy("user_date desc");
     return $dataProvider;
 }
コード例 #3
0
ファイル: UserController.php プロジェクト: hehekeke/mir_web
 /**
  * Finds the MirUser model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MirUser the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MirUser::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }