diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index 72eb12a7f..bf2e49999 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -311,6 +311,13 @@ class PreorderApicontroller extends mfBaseApicontroller { $unit_search[$key] = trim($this->post['address']->$key); } } + + + // ignore unit_string if the specific fields were provided + if($unit_search['block'] || $unit_search['stiege'] || $unit_search['stock'] || $unit_search['tuer']) { + unset($unit_search['unit_string']); + } + if($zusatz) { $unit_search['zusatz'] = $zusatz; } @@ -592,6 +599,7 @@ class PreorderApicontroller extends mfBaseApicontroller { } } } + // get units excluding unavailable units $where = "hausnummer_id=".$address->hausnummer_id; $where .= " AND ( block = '' OR block IS NULL)";