From 481d46fdce9e89b87daaab95c3ada1dca97cff30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 05:31:20 +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=9A=E9=80=80=E6=AC=BE=E6=B2=BB=E7=90=86=E5=8C=BA?= =?UTF-8?q?=E5=9D=97=E5=A2=9E=E5=8A=A0=E9=80=80=E6=AC=BE=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E5=88=97=E8=A1=A8=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/show.blade.php | 3 + ...OrderShowRefundGovernanceBlockLinkTest.php | 70 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderShowRefundGovernanceBlockLinkTest.php diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index 0124a24..af96abf 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -95,6 +95,9 @@
退款状态治理(仅修正状态,不自动写回执/退款回执)
已付:¥{{ number_format($paidAmountFloat, 2) }}|退款总额:¥{{ number_format($refundTotal, 2) }}
+ @if($canMarkRefunded)
diff --git a/tests/Feature/AdminPlatformOrderShowRefundGovernanceBlockLinkTest.php b/tests/Feature/AdminPlatformOrderShowRefundGovernanceBlockLinkTest.php new file mode 100644 index 0000000..2c5a8ba --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowRefundGovernanceBlockLinkTest.php @@ -0,0 +1,70 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_show_page_refund_governance_block_has_refund_inconsistent_list_link(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'refund_governance_block_link_01', + 'name' => '退款治理区块链接测试', + '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_REFUND_GOV_BLOCK_LINK_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' => [ + 'refund_summary' => [ + 'count' => 1, + 'total_amount' => 10.00, + ], + ], + ]); + + $this->get('/admin/platform-orders/' . $order->id) + ->assertOk() + ->assertSee('查看全部退款不一致订单') + ->assertSee('/admin/platform-orders?refund_inconsistent=1'); + } +}