diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 8ce9165..74c395f 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -597,9 +597,15 @@ @endif
用于“线下收款/转账/人工核对”的留痕记录(当前阶段先落 meta,不引入独立表)。
diff --git a/tests/Feature/AdminPlatformOrderReconcileMismatchRowHintTest.php b/tests/Feature/AdminPlatformOrderReconcileMismatchRowHintTest.php new file mode 100644 index 0000000..b6f0ef0 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderReconcileMismatchRowHintTest.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_can_show_reconcile_mismatch_hint_and_link_to_payment_receipts_anchor(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'reconcile_mismatch_row_hint_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_RECON_ROW_HINT_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' => [ + 'payment_summary' => [ + 'count' => 1, + 'total_amount' => 9.99, + ], + ], + ]); + + $this->get('/admin/platform-orders?reconcile_mismatch=1') + ->assertOk() + ->assertSee('PO_RECON_ROW_HINT_0001') + ->assertSee('/admin/platform-orders/' . $order->id . '#payment-receipts', false) + ->assertSee('对账不一致'); + } +}