From 9633d7e4ec417414bfcd42bd6fa03f1cbe362668 Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Sun, 10 Nov 2024 21:47:44 +0100 Subject: [PATCH] =?UTF-8?q?Kalender=20ADDRESS=20MODEL=20*=20Update=20des?= =?UTF-8?q?=20Address=20Models=20Hab=20einen=20Searchkey=20hinzugef=C3=BCg?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/Address/AddressModel.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/application/Address/AddressModel.php b/application/Address/AddressModel.php index 1c0f2841f..c62dd5711 100644 --- a/application/Address/AddressModel.php +++ b/application/Address/AddressModel.php @@ -225,7 +225,6 @@ class AddressModel { $sql .= " LIMIT " . $limit['count']; } } - mfLoghandler::singleton()->debug($sql); $res = $db->query($sql); @@ -484,7 +483,16 @@ class AddressModel { $where .= " " . $filter['add-where']; } - //var_dump($filter, $where);exit; + if (array_key_exists("Controller!", $filter)) { + $termstring = trim($filter['search_term!']); + $termExplode = explode(" ", $termstring); + foreach ($termExplode as $term) { + $wherestring .= " AND (`customer_number` LIKE '%" . $term . "%' OR `company` LIKE '%" . $term . "%' OR `firstname` LIKE '%" . $term . "%' OR `lastname` LIKE '%" . $term . "%' OR `street` LIKE '%" . $term . "%' OR `zip` LIKE '%" . $term . "%' OR `city` LIKE '%" . $term . "%') "; + } + $where .= " AND customer_number > 0 $wherestring"; + } + +// var_dump($filter, $where);exit; return $where; }