diff --git a/public/css/admin-components.css b/public/css/admin-components.css index c250f16..e15b365 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -322,6 +322,25 @@ box-shadow:var(--adm-shadow-sm); } +/* 迷你图表的摘要行(用于展示合计/峰值等口径,参考 Ant Design Pro 的 card extra/meta 文案) */ +.adm-mini-meta{ + margin-top:8px; + display:flex; + flex-wrap:wrap; + gap:6px; + align-items:center; + color:var(--adm-text-secondary, #64748b); + font-size:12px; +} + +.adm-mini-meta-item strong{ + color:var(--adm-text, #0f172a); +} + +.adm-mini-meta-sep{ + color:var(--adm-text-muted, #94a3b8); +} + .adm-mini-chart.is-empty, .adm-mini-rank.is-empty, .adm-mini-share.is-empty{ diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index be0da1b..62d65de 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -97,6 +97,24 @@
+ @php + $trendPaidTotal = 0.0; + $trendOrdersTotal = 0; + $trendPaidMax = 0.0; + foreach ($trendRows as $r) { + $trendPaidTotal += (float) ($r['paid_sum'] ?? 0); + $trendOrdersTotal += (int) ($r['count'] ?? 0); + $trendPaidMax = max($trendPaidMax, (float) ($r['paid_sum'] ?? 0)); + } + @endphp +
+ 7天合计已付:¥{{ number_format($trendPaidTotal, 2) }} + + 7天订单数:{{ (int) $trendOrdersTotal }} + + 峰值:¥{{ number_format($trendPaidMax, 2) }} +
+ diff --git a/tests/Feature/AdminDashboardPlatformOrderTrend7dShouldRenderTest.php b/tests/Feature/AdminDashboardPlatformOrderTrend7dShouldRenderTest.php index 1588f20..ba20d48 100644 --- a/tests/Feature/AdminDashboardPlatformOrderTrend7dShouldRenderTest.php +++ b/tests/Feature/AdminDashboardPlatformOrderTrend7dShouldRenderTest.php @@ -79,6 +79,7 @@ class AdminDashboardPlatformOrderTrend7dShouldRenderTest extends TestCase $res->assertSee('data-role="platform-order-trend-7d"', false); $res->assertSee('data-role="platform-order-trend-7d-chart"', false); + $res->assertSee('data-role="platform-order-trend-7d-meta"', false); $res->assertSee('近7天平台订单(按天)'); // 断言日期行出现(只验证两个代表点)