/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Work::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(['kpi' => $this->kpi, 'target' => $this->target, 'result' => $this->result]); $query->andFilterWhere(['like', 'prov', $this->prov]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = WorkModel::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, 'konkurs_id' => $this->konkurs_id, 'user_id' => $this->user_id, 'category_id' => $this->category_id, 'date' => $this->date]); $query->andFilterWhere(['like', 'file_name', $this->file_name])->andFilterWhere(['like', 'file_type', $this->file_type])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'picture', $this->picture]); return $dataProvider; }