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; }