From 1f8cd24e55a90c8c60d330777039b79af9a5cb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 12:35:56 +0000 Subject: [PATCH] platform_orders index: show paid-but-no-receipt hint with fix link --- .../admin/platform_orders/index.blade.php | 13 +++ ...ctViewPaidButNoReceiptShowsFixLinkTest.php | 83 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexCompactViewPaidButNoReceiptShowsFixLinkTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 53c4c9d..68f158f 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1060,6 +1060,19 @@ {{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }}
{{ $order->payment_status }}
+ + @php + $hasReceiptEvidenceRow = (data_get($order->meta, 'payment_summary.total_amount') !== null) + || (data_get($order->meta, 'payment_receipts.0.amount') !== null); + $noReceiptFixUrlRow = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $selfWithoutBack]) . '#add-payment-receipt'; + @endphp + @if($order->payment_status === 'paid' && ! $hasReceiptEvidenceRow) +
+ 无回执 + + 去补回执 +
+ @endif ¥{{ number_format((float) $order->payable_amount, 2) }} ¥{{ number_format((float) $order->paid_amount, 2) }} diff --git a/tests/Feature/AdminPlatformOrderIndexCompactViewPaidButNoReceiptShowsFixLinkTest.php b/tests/Feature/AdminPlatformOrderIndexCompactViewPaidButNoReceiptShowsFixLinkTest.php new file mode 100644 index 0000000..f1cd17b --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexCompactViewPaidButNoReceiptShowsFixLinkTest.php @@ -0,0 +1,83 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_compact_view_shows_fix_link_when_paid_but_no_receipt_evidence(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + + $plan = Plan::query()->create([ + 'code' => 'compact_view_no_receipt_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_COMPACT_NO_RECEIPT_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(), + // 关键:无 payment_summary / payment_receipts + 'meta' => [], + ]); + + $res = $this->get('/admin/platform-orders?status=activated'); + $res->assertOk(); + + $indexSelfWithoutBack = '/admin/platform-orders?' . Arr::query([ + 'status' => 'activated', + ]); + + $fixUrl = '/admin/platform-orders/' . $order->id . '?' . Arr::query([ + 'back' => $indexSelfWithoutBack, + ]) . '#add-payment-receipt'; + + $res->assertSee('无回执', false); + $res->assertSee($fixUrl, false); + $res->assertSee('去补回执', false); + + // full 视图:仍应保留该提示(因为“无回执”不属于对账差额/退款总额等可选列的内容) + $this->get('/admin/platform-orders?status=activated&view=full') + ->assertOk() + ->assertSee('无回执', false); + } +}