Added fields to POST /preorder

This commit is contained in:
Frank Schubert
2022-09-23 16:02:03 +02:00
parent 2db0249c1c
commit 2da58d36d3
8 changed files with 347 additions and 230 deletions
+13 -1
View File
@@ -32,11 +32,23 @@ class AddressdbApicontroller extends mfBaseApicontroller {
protected function findCity() {
$search = $this->db()->escape(trim($this->post['search']));
$city = $this->db()->escape(trim($this->post['city']));
$zip = $this->db()->escape(trim($this->post['zip']));
if($city) {
$search = $city;
}
if(!$search) {
return mfResponse::BadRequest(['message' => "Searchstring cannot be empty!"]);
}
$results = ADBGemeindeModel::search(['name%' => $search]);
$city_search = ['name%' => $search];
if($zip) {
$city_search['zip'] = $zip;
}
$results = ADBGemeindeModel::search($city_search);
$cities = [];