public function search($params) { $query = ProductTypeHasDiagnos::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['diagnos_id' => $this->diagnos_id, 'product_type_id' => $this->product_type_id]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getProductTypeHasDiagnos() { return $this->hasMany(ProductTypeHasDiagnos::className(), ['product_type_id' => 'id']); }