/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Uploadallcdc::find(); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 30], 'sort' => ['defaultOrder' => ['upload_date' => SORT_DESC, 'upload_time' => SORT_DESC]]]); $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(['id' => $this->id]); $query->andFilterWhere(['like', 'hospcode', $this->hospcode])->andFilterWhere(['like', 'file_name', $this->file_name])->andFilterWhere(['like', 'file_size', $this->file_size])->andFilterWhere(['like', 'upload_date', $this->upload_date])->andFilterWhere(['like', 'upload_time', $this->upload_time])->andFilterWhere(['like', 'note1', $this->note1])->andFilterWhere(['like', 'note2', $this->note2])->andFilterWhere(['like', 'note3', $this->note3])->andFilterWhere(['like', 'note4', $this->note4])->andFilterWhere(['like', 'note5', $this->note5]); return $dataProvider; }