public function filterQuery(ActiveQuery $query) { if ($this->type) { $query->innerJoinWith('type'); $query->andWhere(['{{death_reason_type}}.[[key]]' => $this->type]); } return $query; }
public function filterQuery(ActiveQuery $query) { if ($this->weapon) { $query->andWhere(['{{weapon}}.[[key]]' => $this->weapon]); } if ($this->type) { $query->innerJoinWith('type'); $query->andWhere(['{{weapon_type}}.[[key]]' => $this->type]); } if ($this->sub) { $query->innerJoinWith('subweapon'); $query->andWhere(['{{subweapon}}.[[key]]' => $this->sub]); } if ($this->special) { $query->innerJoinWith('special'); $query->andWhere(['{{special}}.[[key]]' => $this->special]); } return $query; }