From 2e8c9cec1b450cc569c4c58755f0dbf16485079c Mon Sep 17 00:00:00 2001 From: Christopher Stebe Date: Tue, 19 Apr 2016 16:12:37 +0200 Subject: [PATCH] updated query options, action index query default controller api action index by domain_id OR access_domain, was only possible in combination --- controllers/api/DefaultController.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 +}