Fixed Address Filter
This commit is contained in:
@@ -81,7 +81,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_inspection_planner">Begehung Planer</label>
|
||||
<select name="filter[inspection_planner]" id="filter_inspection_planner" class="form-control">
|
||||
<option value="">Alle</option>
|
||||
|
||||
@@ -410,10 +410,8 @@ class ConstructionConsent extends mfBaseModel {
|
||||
ELSE 'blue'
|
||||
END AS status_light
|
||||
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 ConstructionConsentOwner cwo ON ConstructionConsent.id = cwo.constructionconsent_id
|
||||
LEFT JOIN addressdb.view_hausnummer vh ON ConstructionConsent.adb_hausnummer_id = vh.hausnummer_id
|
||||
WHERE $where
|
||||
GROUP BY ConstructionConsent.id
|
||||
$having
|
||||
@@ -490,6 +488,13 @@ 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%')";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status", $filter)) {
|
||||
$status = FronkDB::singleton()->escape($filter["status"]);
|
||||
if($status) {
|
||||
|
||||
Reference in New Issue
Block a user