PreorderApi/submit: ignoring unit_string if the specific fields were provided

This commit is contained in:
Frank Schubert
2023-03-22 16:02:08 +01:00
parent b3b244413d
commit 0d9824ea84

View File

@@ -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)";