fixed fcp search

This commit is contained in:
2025-08-19 14:45:57 +02:00
parent 7452588a2a
commit 8e867992aa

View File

@@ -351,7 +351,7 @@ class PreorderModel
}
mfLoghandler::singleton()->debug($sql);
die($sql);
$res = $db->query($sql);
if ($db->num_rows($res)) {
@@ -1112,22 +1112,12 @@ class PreorderModel
$db = FronkDB::singleton();
$campaign = new Preordercampaign($filter['preordercampaign_id']);
if (is_array($fcp)) {
$items = array_map(fn($i) => ADBRimoFcp::getAll([
'netzgebiet_id' => intval($campaign->network->adb_netzgebiet_id),
'name' => $i])[0], array_filter($fcp));
$items = array_map(fn($i) => $i->id, array_filter($items));
if ($items) $where .= " AND adb_hausnummer.fcp_id IN (" . implode(',', $items) . ")";
$where .= " AND adb_hausnummer.rimo_fcp_name IN ('" . implode("','", array_map(fn($i) => $db->escape($i), $fcp)) . "')";
} else {
$fcp = ADBRimoFcp::getAll([
'netzgebiet_id' => intval($campaign->network->adb_netzgebiet_id),
'name' => $fcp]);
if ($fcp) $fcp = $fcp[0]->id;
else $fcp = null;
$where .= " AND adb_hausnummer.rimo_fcp_name = '" . $db->escape($fcp) . "'";
$fcp = $db->escape($fcp);
if ($fcp) {
$where .= " AND adb_hausnummer.rimo_fcp_name = '$fcp'";
}
}
}