diff --git a/controllers/api/DefaultController.php b/controllers/api/DefaultController.php index ffddc45..86bf6b1 100644 --- a/controllers/api/DefaultController.php +++ b/controllers/api/DefaultController.php @@ -45,13 +45,11 @@ public function actions() if (isset($_GET[$modelClass::ATTR_ID])) { $query->andFilterWhere([$modelClass::ATTR_ID => $_GET[$modelClass::ATTR_ID]]); } - if (isset($_GET[$modelClass::ATTR_DOMAIN_ID]) && isset($_GET[$modelClass::ATTR_ACCESS_DOMAIN])) { - $query->andFilterWhere( - [$modelClass::ATTR_DOMAIN_ID => $_GET[$modelClass::ATTR_DOMAIN_ID]] - ); - $query->andFilterWhere( - [$modelClass::ATTR_ACCESS_DOMAIN => $_GET[$modelClass::ATTR_ACCESS_DOMAIN]] - ); + if (isset($_GET[$modelClass::ATTR_DOMAIN_ID])) { + $query->andFilterWhere([$modelClass::ATTR_DOMAIN_ID => $_GET[$modelClass::ATTR_DOMAIN_ID]]); + } + if (isset($_GET[$modelClass::ATTR_ACCESS_DOMAIN])) { + $query->andFilterWhere([$modelClass::ATTR_ACCESS_DOMAIN => $_GET[$modelClass::ATTR_ACCESS_DOMAIN]]); } if (isset($_GET[$modelClass::ATTR_ROOT])) { $query->andFilterWhere([$modelClass::ATTR_ROOT => $_GET[$modelClass::ATTR_ROOT]]); @@ -69,4 +67,4 @@ public function actions() ] ]; } -} \ No newline at end of file +}