예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Designer::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, 'uid' => $this->uid, 'auth_type' => $this->auth_type, 'province' => $this->province, 'city' => $this->city, 'feeh' => $this->feeh, 'feel' => $this->feel, 'is_show' => $this->is_show, 'is_rec' => $this->is_rec, 'orderid' => $this->orderid, 'level' => $this->level, 'create_uid' => $this->create_uid, 'create_at' => $this->create_at]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'sentence', $this->sentence])->andFilterWhere(['like', 'avatar', $this->avatar])->andFilterWhere(['like', 'label', $this->label])->andFilterWhere(['like', 'exp', $this->exp])->andFilterWhere(['like', 'good_style', $this->good_style])->andFilterWhere(['like', 'good_space', $this->good_space])->andFilterWhere(['like', 'brief', $this->brief])->andFilterWhere(['like', 'award', $this->award])->andFilterWhere(['like', 'bgimg', $this->bgimg]);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Designer::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(['designer_birthdate' => $this->designer_birthdate]);
     $query->andFilterWhere(['like', 'designer_user_name', $this->designer_user_name])->andFilterWhere(['like', 'designer_first_name', $this->designer_first_name])->andFilterWhere(['like', 'designer_last_name', $this->designer_last_name])->andFilterWhere(['like', 'designer_address1', $this->designer_address1])->andFilterWhere(['like', 'designer_address2', $this->designer_address2])->andFilterWhere(['like', 'designer_email', $this->designer_email])->andFilterWhere(['like', 'designer_gender', $this->designer_gender])->andFilterWhere(['like', 'designer_from', $this->designer_from])->andFilterWhere(['like', 'designer_favcolor', $this->designer_favcolor]);
     return $dataProvider;
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDesigner()
 {
     return $this->hasOne(Designer::className(), ['designer_user_name' => 'user_name']);
 }
예제 #4
0
 /**
  * Finds the Designer model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Designer the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Designer::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }