From 61d50090a62b611b5d85c8e0e27c5488f844f72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 00:13:01 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=EF=BC=9ABMPA=E7=A6=81=E7=94=A8=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=BA=E6=B2=BB=E7=90=86=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/show.blade.php | 33 +++++--- ...MarkPaidAndActivateGovernanceBlockTest.php | 77 +++++++++++++++++++ 2 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 tests/Feature/AdminPlatformOrderShowMarkPaidAndActivateGovernanceBlockTest.php diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index e01d72b..fd6e250 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -184,17 +184,28 @@ - @if($markPaidBlockedByRefund) -
- 提示:当前订单已存在退款记录/退款汇总,建议先核对退款轨迹与状态后再进行「标记支付并生效」。 - - 去核对退款 -
- @elseif($markPaidBlockedByReceiptMismatch) -
- 提示:当前订单已存在支付回执,但回执总额与订单金额不一致,建议先补齐/修正回执后再进行「标记支付并生效」。 - - 去补回执 + @if($markPaidBlockedByRefund || $markPaidBlockedByReceiptMismatch) +
+
BMPA 治理提示(当前不建议/不可直接标记支付并生效)
+
+ @if($markPaidBlockedByRefund) +
+ 原因:当前订单已存在退款记录/退款汇总。 + + 去核对退款 +
+ @endif + @if($markPaidBlockedByReceiptMismatch) +
+ 原因:当前订单已存在支付回执,但回执总额与订单金额不一致。 + + 去补回执 +
+ @endif +
+ 建议:先补齐/修正回执与退款轨迹(使金额与状态口径一致),再执行 BMPA。 +
+
@endif diff --git a/tests/Feature/AdminPlatformOrderShowMarkPaidAndActivateGovernanceBlockTest.php b/tests/Feature/AdminPlatformOrderShowMarkPaidAndActivateGovernanceBlockTest.php new file mode 100644 index 0000000..8f258dd --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowMarkPaidAndActivateGovernanceBlockTest.php @@ -0,0 +1,77 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_should_render_governance_block_when_bmpa_blocked(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'po_show_bmpa_gov_block_plan', + 'name' => 'BMPA治理提示块测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $order = PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'order_no' => 'PO_SHOW_BMPA_GOV_BLOCK_0001', + 'order_type' => 'new_purchase', + 'status' => 'pending', + 'payment_status' => 'unpaid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 10, + 'paid_amount' => 0, + 'placed_at' => now(), + 'meta' => [ + 'refund_receipts' => [ + [ + 'type' => 'refund', + 'channel' => 'offline', + 'amount' => 1, + 'refunded_at' => now()->toDateTimeString(), + 'note' => 'test-refund', + 'created_at' => now()->toDateTimeString(), + 'admin_id' => 1, + ], + ], + ], + ]); + + $res = $this->get('/admin/platform-orders/' . $order->id); + $res->assertOk(); + + $res->assertSee('BMPA 治理提示', false); + $res->assertSee('去核对退款', false); + $res->assertSee('href="#refund-receipts"', false); + } +}