diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 90c21f8..db6a772 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -277,10 +277,14 @@ $poSyncFailed = (int) ($stats['platform_orders_sync_failed'] ?? 0); $poNoReceipt = (int) ($stats['platform_orders_paid_no_receipt'] ?? 0); $poRenewalMissing = (int) ($stats['platform_orders_renewal_missing_subscription'] ?? 0); + $poReconcileMismatch = (int) ($stats['platform_orders_reconcile_mismatch'] ?? 0); + $poRefundInconsistent = (int) ($stats['platform_orders_refund_inconsistent'] ?? 0); $poSyncFailedPct = $poTotal > 0 ? min(100, max(0, round(($poSyncFailed / $poTotal) * 100, 1))) : 0; $poNoReceiptPct = $poTotal > 0 ? min(100, max(0, round(($poNoReceipt / $poTotal) * 100, 1))) : 0; $poRenewalMissingPct = $poTotal > 0 ? min(100, max(0, round(($poRenewalMissing / $poTotal) * 100, 1))) : 0; + $poReconcileMismatchPct = $poTotal > 0 ? min(100, max(0, round(($poReconcileMismatch / $poTotal) * 100, 1))) : 0; + $poRefundInconsistentPct = $poTotal > 0 ? min(100, max(0, round(($poRefundInconsistent / $poTotal) * 100, 1))) : 0; @endphp @php @@ -347,6 +351,22 @@
{{ $poRenewalMissingPct }}%({{ $poRenewalMissing }})
+ + +
对账不一致
+
+ +
+
{{ $poReconcileMismatchPct }}%({{ $poReconcileMismatch }})
+
+ + +
退款不一致
+
+ +
+
{{ $poRefundInconsistentPct }}%({{ $poRefundInconsistent }})
+
diff --git a/tests/Feature/AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest.php b/tests/Feature/AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest.php index be4f014..e803096 100644 --- a/tests/Feature/AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest.php +++ b/tests/Feature/AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest.php @@ -28,7 +28,7 @@ class AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest extends TestCase $html = (string) $res->getContent(); - // 行可点击(漏斗 + 治理) + // 行可点击(漏斗 + 治理 + 订阅到期) $this->assertStringContainsString('adm-mini-bar-row-link', $html); // 漏斗:待支付 / 待生效 / 可同步 @@ -36,12 +36,18 @@ class AdminDashboardMiniBarRowsShouldLinkToGovernanceScopesTest extends TestCase $this->assertStringContainsString('href="/admin/platform-orders?payment_status=paid&status=pending&sync_status=unsynced&back=%2Fadmin"', $html); $this->assertStringContainsString('href="/admin/platform-orders?syncable_only=1&sync_status=unsynced&back=%2Fadmin"', $html); - // 治理:同步失败 / 无回执 / 续费缺订阅 + // 治理:同步失败 / 无回执 / 续费缺订阅 / 对账不一致 / 退款不一致 $this->assertStringContainsString('href="/admin/platform-orders?sync_status=failed&back=%2Fadmin"', $html); $this->assertStringContainsString('href="/admin/platform-orders?payment_status=paid&receipt_status=none&back=%2Fadmin"', $html); $this->assertStringContainsString('href="/admin/platform-orders?renewal_missing_subscription=1&back=%2Fadmin"', $html); + $this->assertStringContainsString('href="/admin/platform-orders?reconcile_mismatch=1&back=%2Fadmin"', $html); + $this->assertStringContainsString('href="/admin/platform-orders?refund_inconsistent=1&back=%2Fadmin"', $html); - // back 参数不得被 Blade escape 成 &back(避免 nested back/可读性问题) + // 订阅到期治理 + $this->assertStringContainsString('href="/admin/site-subscriptions?expiry=expiring_7d&back=%2Fadmin"', $html); + $this->assertStringContainsString('href="/admin/site-subscriptions?expiry=expired&back=%2Fadmin"', $html); + + // back 参数不得被 Blade escape 成 &back $this->assertStringNotContainsString('&back=', $html); } } diff --git a/tests/Feature/AdminDashboardPlatformOrderGovernanceMiniBarsShouldRenderTest.php b/tests/Feature/AdminDashboardPlatformOrderGovernanceMiniBarsShouldRenderTest.php index 37742d1..1718cb9 100644 --- a/tests/Feature/AdminDashboardPlatformOrderGovernanceMiniBarsShouldRenderTest.php +++ b/tests/Feature/AdminDashboardPlatformOrderGovernanceMiniBarsShouldRenderTest.php @@ -32,5 +32,7 @@ class AdminDashboardPlatformOrderGovernanceMiniBarsShouldRenderTest extends Test $this->assertStringContainsString('data-role="dashboard-po-sync-failed-bar"', $html); $this->assertStringContainsString('data-role="dashboard-po-no-receipt-bar"', $html); $this->assertStringContainsString('data-role="dashboard-po-renewal-missing-bar"', $html); + $this->assertStringContainsString('data-role="dashboard-po-reconcile-mismatch-bar"', $html); + $this->assertStringContainsString('data-role="dashboard-po-refund-inconsistent-bar"', $html); } }