/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Order::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, 'user_id' => $this->user_id, 'medicine_id' => $this->medicine_id, 'hotsale_id' => $this->hotsale_id, 'amount' => $this->amount, 'create_time' => $this->create_time, 'street_number' => $this->street_number, 'status' => $this->status, 'update_time' => $this->update_time, 'delect' => $this->delect, 'total' => $this->total]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'street', $this->street])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'zipcord', $this->zipcord]); return $dataProvider; }