feat: clean up and optimize FCP filter and highlighting logic
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user