示例#1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = VetClinic::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'logo_img', $this->logo_img])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'working_time', $this->working_time])->andFilterWhere(['like', 'delivery', $this->delivery])->andFilterWhere(['like', 'phone_1', $this->phone_1])->andFilterWhere(['like', 'phone_2', $this->phone_2])->andFilterWhere(['like', 'phone_3', $this->phone_3])->andFilterWhere(['like', 'slug', $this->slug])->andFilterWhere(['like', 'lat', $this->lat])->andFilterWhere(['like', 'lng', $this->lng]);
     return $dataProvider;
 }