Fixed Filter for ADB Street in ConstructionConsent.php

This commit is contained in:
Luca Haid
2025-02-25 14:47:23 +01:00
parent 64d2df213d
commit de52191313

View File

@@ -412,6 +412,7 @@ class ConstructionConsent extends mfBaseModel {
FROM ConstructionConsent
LEFT JOIN ConstructionConsentOwner cwo ON ConstructionConsent.id = cwo.constructionconsent_id
LEFT JOIN addressdb.view_hausnummer vh ON ConstructionConsent.adb_hausnummer_id = vh.hausnummer_id
LEFT JOIN addressdb.Strasse vs ON ConstructionConsent.adb_strasse_id = vs.id
WHERE $where
GROUP BY ConstructionConsent.id
$having
@@ -491,7 +492,7 @@ class ConstructionConsent extends mfBaseModel {
if(array_key_exists("address", $filter)) {
$address = FronkDB::singleton()->escape($filter["address"]);
if($address) {
$where .= " AND (vh.strasse LIKE '%$address%' OR vh.hausnummer LIKE '%$address%' OR vh.plz LIKE '%$address%' OR vh.ortschaft LIKE '%$address%' OR vh.gemeinde LIKE '%$address%')";
$where .= " AND (vs.name LIKE '%$address%' OR vh.strasse LIKE '%$address%' OR vh.hausnummer LIKE '%$address%' OR vh.plz LIKE '%$address%' OR vh.ortschaft LIKE '%$address%' OR vh.gemeinde LIKE '%$address%')";
}
}