Skip to content

Commit

Permalink
updated query options, action index
Browse files Browse the repository at this point in the history
query default controller api action index by domain_id OR access_domain, was only possible in combination
  • Loading branch information
Christopher Stebe committed Apr 19, 2016
1 parent 7e431b3 commit 2e8c9ce
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions controllers/api/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]]);
Expand All @@ -69,4 +67,4 @@ public function actions()
]
];
}
}
}

0 comments on commit 2e8c9ce

Please sign in to comment.