feat: add fcp map
fix: fixed lazy fcp search fix: try to fix preorder filter
This commit is contained in:
@@ -1005,14 +1005,26 @@ class PreorderModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($filter['fcp'])) {
|
||||
if (!empty($filter['fcp']) && array_key_exists("preordercampaign_id", $filter)) {
|
||||
$fcp = $filter['fcp'];
|
||||
$db = FronkDB::singleton();
|
||||
$campaign = new Preordercampaign($filter['preordercampaign_id']);
|
||||
if (is_array($fcp)) {
|
||||
$items = array_map(fn($i) => "'" . $db->escape($i) . "'", array_filter($fcp));
|
||||
if ($items) $where .= " AND adb_hausnummer.rimo_fcp_name IN (" . implode(',', $items) . ")";
|
||||
$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) . ")";
|
||||
} 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) . "'";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user