feat: clean up and optimize FCP filter and highlighting logic

This commit is contained in:
2026-02-27 12:36:01 +01:00
parent ad8c6eaeca
commit be9e6ae4e5
3 changed files with 7 additions and 8 deletions

View File

@@ -1452,11 +1452,11 @@ class PreorderController extends mfBaseController {
if (empty($fcps)) return [];
$filter = $this->request->filter ?? [];
// We want to count preorders matching ALL other filters, but ignoring the current FCP filter
if (isset($filter['fcp'])) {
unset($filter['fcp']);
}
$filter = $this->getPreparedFilter($filter);
$statsMap = PreorderModel::countActiveGroupedByFcp($filter);
$result = array_map(
@@ -1466,7 +1466,7 @@ class PreorderController extends mfBaseController {
"text" => $fcp->name ?? null,
'lat' => $fcp->gps_lat ?? null,
'lng' => $fcp->gps_long ?? null,
'preorder_count' => $statsMap[$fcp->id] ?? 0
'preorder_count' => $statsMap[$fcp->name] ?? 0
],
$fcps
);