refactor(dashboard): inject 7d range from controller to avoid drift
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
'plans' => \App\Support\BackUrl::withBack('/admin/plans', $selfWithoutBack),
|
||||
];
|
||||
|
||||
// 仪表盘内所有“近7天”口径统一在这里计算,避免散落 now()->subDays(6) 导致未来改动遗漏。
|
||||
$rangeFrom7d = now()->subDays(6)->format('Y-m-d');
|
||||
$rangeTo7d = now()->format('Y-m-d');
|
||||
// 仪表盘内所有“近7天”口径统一从 Controller 注入(避免 Blade 内 now() 计算导致跨天漂移)。
|
||||
$rangeFrom7d = (string) ($dashboardRangeFrom7d ?? now()->subDays(6)->format('Y-m-d'));
|
||||
$rangeTo7d = (string) ($dashboardRangeTo7d ?? now()->format('Y-m-d'));
|
||||
|
||||
$platformOrdersQuickLinks = [
|
||||
// 复用工作台入口(避免 /admin/platform-orders 入口口径分叉)
|
||||
|
||||
Reference in New Issue
Block a user