Dashboard: add BMPA failed to governance mini bars

This commit is contained in:
萝卜
2026-03-17 02:56:45 +08:00
parent db6fd9a9b7
commit f04680a498
3 changed files with 13 additions and 1 deletions

View File

@@ -275,12 +275,14 @@
@php
$poTotal = (int) ($stats['platform_orders'] ?? 0);
$poSyncFailed = (int) ($stats['platform_orders_sync_failed'] ?? 0);
$poBmpaFailed = (int) ($stats['platform_orders_bmpa_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;
$poBmpaFailedPct = $poTotal > 0 ? min(100, max(0, round(($poBmpaFailed / $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;
@@ -336,6 +338,14 @@
<div class="adm-mini-bar-value">{{ $poSyncFailedPct }}%{{ $poSyncFailed }}</div>
</a>
<a class="adm-mini-bar-row adm-mini-bar-row-link mt-6" data-role="dashboard-po-bmpa-failed-row" href="{!! \App\Support\BackUrl::withBack('/admin/platform-orders?bmpa_failed_only=1', $selfWithoutBack) !!}" aria-label="进入BMPA失败订单集合">
<div class="adm-mini-bar-label">BMPA失败</div>
<div class="adm-mini-bar" data-role="dashboard-po-bmpa-failed-bar" title="{{ $poBmpaFailed }} / {{ $poTotal }}{{ $poBmpaFailedPct }}%">
<span class="adm-mini-bar-fill" style="width: {{ $poBmpaFailedPct }}%"></span>
</div>
<div class="adm-mini-bar-value">{{ $poBmpaFailedPct }}%{{ $poBmpaFailed }}</div>
</a>
<a class="adm-mini-bar-row adm-mini-bar-row-link mt-6" data-role="dashboard-po-no-receipt-row" href="{!! \App\Support\BackUrl::withBack('/admin/platform-orders?payment_status=paid&receipt_status=none', $selfWithoutBack) !!}" aria-label="进入无回执订单集合">
<div class="adm-mini-bar-label">无回执</div>
<div class="adm-mini-bar" data-role="dashboard-po-no-receipt-bar" title="{{ $poNoReceipt }} / {{ $poTotal }}{{ $poNoReceiptPct }}%">