diff --git a/resources/views/admin/components/mini_bar.blade.php b/resources/views/admin/components/mini_bar.blade.php new file mode 100644 index 0000000..10ed8a0 --- /dev/null +++ b/resources/views/admin/components/mini_bar.blade.php @@ -0,0 +1,25 @@ +@php + /** + * Admin UI Component: Mini Bar + * + * Required: + * - $pct + * + * Optional: + * - $role (data-role) + * - $title + */ + + $pct = (float) ($pct ?? 0); + $role = (string) ($role ?? ''); + $title = (string) ($title ?? ''); + + $pct = max(0, min(100, $pct)); +@endphp + +
+ +
diff --git a/resources/views/admin/site_subscriptions/index.blade.php b/resources/views/admin/site_subscriptions/index.blade.php index b224900..01ed6f6 100644 --- a/resources/views/admin/site_subscriptions/index.blade.php +++ b/resources/views/admin/site_subscriptions/index.blade.php @@ -132,9 +132,11 @@ $barPct = min(100, max(0, round(((int) $cnt / (int) ($summaryStats['expiring_7d_subscriptions'] ?? 1)) * 100, 1))); } @endphp -
- -
+ @include('admin.components.mini_bar', [ + 'role' => 'expiry-merchant-bar', + 'pct' => $barPct, + 'title' => '占比 ' . $barPct . '%', + ]) {{ $minEndsAt !== '' ? $minEndsAt : '-' }} @@ -188,9 +190,11 @@ $barPct = min(100, max(0, round(((int) $cnt / (int) ($summaryStats['expiring_7d_subscriptions'] ?? 1)) * 100, 1))); } @endphp -
- -
+ @include('admin.components.mini_bar', [ + 'role' => 'expiry-merchant-plan-bar', + 'pct' => $barPct, + 'title' => '占比 ' . $barPct . '%', + ]) {{ $minEndsAt !== '' ? $minEndsAt : '-' }}