コード例 #1
0
ファイル: FormUser.php プロジェクト: 44132145/TechFunder
 public function CheckEmailInBD($attribute)
 {
     $userObj = user::find()->where(['email' => $this->{$attribute}])->one();
     if ($userObj !== null) {
         $this->addError($attribute, 'email all ready taken');
     }
 }
コード例 #2
0
ファイル: UsersSearch.php プロジェクト: aekkapun/dlt-tcplch
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = user::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])->andFilterWhere(['like', 'email', $this->email]);
     return $dataProvider;
 }
コード例 #3
0
ファイル: userSearch.php プロジェクト: saqbest/social.dev
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = user::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'online' => $this->online]);
     $query->andFilterWhere(['or', ['like', 'first_name', $this->userFullName], ['like', 'last_name', $this->userFullName]])->andFilterWhere(['like', 'gender', $this->gender])->andFilterWhere(['and', ['>=', '((UNIX_TIMESTAMP()-UNIX_TIMESTAMP(`bd_date`))/60/60/24/365)', $this->min_year], ['<=', '((UNIX_TIMESTAMP()-UNIX_TIMESTAMP(`bd_date`))/60/60/24/365)', $this->max_year]])->andFilterWhere(['like', 'country', $this->country]);
     return $dataProvider;
 }
コード例 #4
0
ファイル: Users.php プロジェクト: shamim258038/myMvc
 public function editShow($id)
 {
     return view('userEditForm', user::find($id));
 }
コード例 #5
0
ファイル: RefController.php プロジェクト: Arokh09/it-service
 public function actionGetUserRef()
 {
     $users = user::find()->orderBy('name ASC')->All();
     foreach ($users as $user) {
         if ($user->active) {
             printf('<option value = %d>%s</option>', $user->id, $user->name);
         } else {
             printf('<option value = %d>%s&nbsp(неактивен)</option>', $user->id, $user->name);
         }
     }
 }
コード例 #6
0
ファイル: TestController.php プロジェクト: saqbest/social.dev
 /**
  * Lists all user models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => user::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }