From 808f104ae87b0596f6f3de76116ec5cf32194477 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 16 Nov 2022 16:20:10 +0100 Subject: [PATCH] Removed unnecessary fields from findAddress api --- application/Api/v1/AddressdbApicontroller.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/Api/v1/AddressdbApicontroller.php b/application/Api/v1/AddressdbApicontroller.php index 5b1b1f79b..2a76e0515 100644 --- a/application/Api/v1/AddressdbApicontroller.php +++ b/application/Api/v1/AddressdbApicontroller.php @@ -286,19 +286,19 @@ class AddressdbApicontroller extends mfBaseApicontroller { $where = "1=1"; - if($search_zip) { + if($search_zip && $search_zip != "%") { $where .= " AND plz like '$search_zip%'"; } - if($search_district) { + if($search_district && $search_district != "%") { $where .= " AND ortschaft like '$search_district%'"; } - if($search_city) { + if($search_city && $search_city != "%") { $where .= " AND gemeinde like '$search_city%'"; } - if($search_street) { + if($search_street && $search_street != "%") { $where .= " AND strasse like '$search_street%'"; } - if($search_housenumber) { + if($search_housenumber && $search_housenumber != "%") { $where .= " AND hausnummer like '$search_housenumber%'"; } @@ -308,6 +308,7 @@ class AddressdbApicontroller extends mfBaseApicontroller { //echo $where; //var_dump($this->filter_salescluster_ids);exit; $sql = "SELECT * FROM view_wohneinheit WHERE $where ORDER BY plz, gemeinde, ortschaft, strasse, LENGTH(hausnummer), hausnummer, block, stiege, stock, LENGTH(tuer), tuer"; + $this->log->debug($sql); $res = $this->db()->query($sql); if($this->db()->num_rows($res)) {