Added fields to POST /preorder
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user