public function searchInvph($params) { $query = Inventorier::find()->where(['inventairephysic' => '1']); $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(['codebien' => $this->codebien, 'anneeinv' => $this->anneeinv, 'comptage1' => $this->comptage1, 'comptage2' => $this->comptage2, 'comptage3' => $this->comptage3]); $query->andFilterWhere(['like', 'obs', $this->obs])->andFilterWhere(['like', 'bureau', $this->bureau])->andFilterWhere(['like', 'inventairephysic', $this->inventairephysic]); return $dataProvider; }