From 2730d656b1e84e0795c6abf9a4cc375ed2a1499d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 08:15:15 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E9=80=80=E6=AC=BE=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E8=A1=8C=E6=8F=90=E7=A4=BA=E8=A1=A5=E9=BD=90=E5=8E=BB=E6=A0=B8?= =?UTF-8?q?=E5=AF=B9=E9=80=80=E6=AC=BE=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/index.blade.php | 7 +- ...erRefundInconsistentRowHintFixLinkTest.php | 71 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderRefundInconsistentRowHintFixLinkTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index db6b81f..9095cdb 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -661,8 +661,13 @@ @endphp @if($refundTotal > 0) @if($isRefundInconsistent) + @php $refundFixUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; @endphp ¥{{ number_format($refundTotal, 2) }} -
疑似不一致
+
+ 疑似不一致 + + 去核对退款 +
@else ¥{{ number_format($refundTotal, 2) }} @endif diff --git a/tests/Feature/AdminPlatformOrderRefundInconsistentRowHintFixLinkTest.php b/tests/Feature/AdminPlatformOrderRefundInconsistentRowHintFixLinkTest.php new file mode 100644 index 0000000..969b3f5 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderRefundInconsistentRowHintFixLinkTest.php @@ -0,0 +1,71 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_orders_row_refund_inconsistent_hint_has_fix_link_to_refund_section(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'refund_inconsistent_fix_link_test', + '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_INCONS_FIX_0001', + 'order_type' => 'new_purchase', + 'status' => 'activated', + 'payment_status' => 'refunded', + '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(), + 'refunded_at' => now(), + 'meta' => [ + 'refund_summary' => [ + 'count' => 1, + 'total_amount' => 9.98, + ], + ], + ]); + + $this->get('/admin/platform-orders?refund_inconsistent=1') + ->assertOk() + ->assertSee('/admin/platform-orders/' . $order->id . '#refund-receipts', false) + ->assertSee('去核对退款'); + } +}