From 646f1b972dc185d13dc5fa7809dfd2a06d580f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 13:22:21 +0000 Subject: [PATCH] platform_orders index: row-warn prefix span for faster scan --- public/css/admin-components.css | 1 + .../admin/platform_orders/index.blade.php | 10 +-- ...tformOrderIndexRowWarnPrefixRenderTest.php | 77 +++++++++++++++++++ 3 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 tests/Feature/AdminPlatformOrderIndexRowWarnPrefixRenderTest.php diff --git a/public/css/admin-components.css b/public/css/admin-components.css index ef4d94b..92a9868 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -93,6 +93,7 @@ .platform-orders-table .row-warn{margin-top:4px;padding:4px 6px;border-left:3px solid #d9534f;background:#fff6f6;border-radius:4px;} .platform-orders-table .row-warn a.link{color:#b52b27;text-decoration:underline;} .platform-orders-table .row-warn a.link:hover{text-decoration:none;} +.platform-orders-table .row-warn-prefix{font-weight:600;} /* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */ .platform-orders-table .governance-hints{margin-bottom:6px;} diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index e9168ba..3207107 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1082,7 +1082,7 @@ @endphp @if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow)
- 无回执 + 无回执 去补回执
@@ -1132,10 +1132,10 @@ @if(! $isFullView) @if($syncErr !== '') -
原因:{{ mb_substr($syncErr, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}
+
原因:{{ mb_substr($syncErr, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}
@endif @if($bmpaErrCompact !== '') -
BMPA:{{ mb_substr($bmpaErrCompact, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}
+
BMPA:{{ mb_substr($bmpaErrCompact, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}
@endif @endif @@ -1376,14 +1376,14 @@
@if($needReconcileFix)
- 对账不一致 + 对账 去补回执
@endif @if($needRefundFix)
- 退款不一致 + 退款 去核对退款
diff --git a/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixRenderTest.php b/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixRenderTest.php new file mode 100644 index 0000000..6efd38b --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixRenderTest.php @@ -0,0 +1,77 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_row_warn_prefix_span_is_rendered_for_no_receipt_and_sync_bmpa_reason(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + + $plan = Plan::query()->create([ + 'code' => 'po_index_row_warn_prefix_plan', + 'name' => '平台订单列表 row-warn prefix 测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'order_no' => 'PO_INDEX_ROW_WARN_PREFIX_0001', + 'order_type' => 'new_purchase', + 'status' => 'activated', + 'payment_status' => 'paid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 10, + 'paid_amount' => 10, + 'placed_at' => now(), + 'paid_at' => now(), + 'activated_at' => now(), + 'meta' => [ + 'subscription_activation_error' => [ + 'message' => 'SIM_SYNC_ERR_2', + 'at' => now()->toDateTimeString(), + ], + 'batch_mark_paid_and_activate_error' => [ + 'message' => 'SIM_BMPA_ERR_2', + 'at' => now()->toDateTimeString(), + ], + ], + ]); + + $res = $this->get('/admin/platform-orders?keyword=PO_INDEX_ROW_WARN_PREFIX_0001'); + $res->assertOk(); + + $res->assertSee('无回执', false); + $res->assertSee('原因', false); + $res->assertSee('BMPA', false); + } +}