public function search($params) { $query = ServiceProduct::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'product_id' => $this->product_id, 'service_id' => $this->service_id]); return $dataProvider; }