added new fcp filter

This commit is contained in:
2025-09-11 14:32:39 +02:00
parent 8a53e31fa3
commit e1bfb5e96d
3 changed files with 115 additions and 26 deletions
@@ -533,6 +533,35 @@ class ADBHausnummerModel {
$where .= ")";
}
if (array_key_exists("rimo_fcp_name", $filter)) {
if (is_array($filter['rimo_fcp_name'])) {
$escapedNames = array_map(function($name) {
return "'" . FronkDB::singleton()->escape($name) . "'";
}, $filter['rimo_fcp_name']);
$where .= " AND Hausnummer.rimo_fcp_name IN (" . implode(", ", $escapedNames) . ")";
} else {
$rimo_fcp_name = FronkDB::singleton()->escape($filter['rimo_fcp_name']);
if ($rimo_fcp_name) {
$where .= " AND Hausnummer.rimo_fcp_name = '$rimo_fcp_name'";
}
}
}
if (array_key_exists("fcp_id", $filter)) {
if (is_array($filter['fcp_id'])) {
$escapedIds = array_map(function($id) {
return "'" . FronkDB::singleton()->escape($id) . "'";
}, $filter['fcp_id']);
$where .= " AND Hausnummer.fcp_id IN (" . implode(", ", $escapedIds) . ")";
} else {
$fcp_id = FronkDB::singleton()->escape($filter['fcp_id']);
if ($fcp_id) {
$where .= " AND Hausnummer.fcp_id = '$fcp_id'";
}
}
}
return $where;
}