$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_product_category' => $this->id_product_category, 'id_account' => $this->id_account, 'status' => $this->status, ]); $query->andFilterWhere(['like', 'product_number', $this->product_number]) ->andFilterWhere(['like', 'barcode', $this->barcode]); return $dataProvider; } }