From bfcb7d77fa70c546aea9f9379282556bf6d6901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Fri, 13 Mar 2026 21:24:06 +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=E5=AF=BC=E5=87=BA=E9=93=BE=E6=8E=A5=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20Arr::query=20=E4=B8=94=E6=96=B0=E5=BC=80=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=88=E4=BF=AE=E5=A4=8D=E6=96=AD=E8=A8=80=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/platform_orders/show.blade.php | 11 +++++++++-- tests/Feature/AdminPlatformOrderExportLedgerTest.php | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index ebd17da..6432f26 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -326,9 +326,16 @@

支付回执(对账留痕)

+ @php + $makeExportLedgerUrl = function (array $query = []) use ($order) { + $query = $query + ['download' => 1]; + + return '/admin/platform-orders/' . $order->id . '/export-ledger?' . \Illuminate\Support\Arr::query($query); + }; + @endphp

用于“线下收款/转账/人工核对”的留痕记录(当前阶段先落 meta,不引入独立表)。

diff --git a/tests/Feature/AdminPlatformOrderExportLedgerTest.php b/tests/Feature/AdminPlatformOrderExportLedgerTest.php index 20011b3..ed820dd 100644 --- a/tests/Feature/AdminPlatformOrderExportLedgerTest.php +++ b/tests/Feature/AdminPlatformOrderExportLedgerTest.php @@ -154,9 +154,13 @@ class AdminPlatformOrderExportLedgerTest extends TestCase $res = $this->get('/admin/platform-orders/' . $order->id); $res->assertOk(); + // 页面应包含两条导出链接(注意:Arr::query 可能调整 query 顺序,因此断言只锁定关键片段) $res->assertSee('/admin/platform-orders/' . $order->id . '/export-ledger?download=1', false); - $res->assertSee('/admin/platform-orders/' . $order->id . '/export-ledger?download=1&include_order_snapshot=1', false); + $res->assertSee('include_order_snapshot=1', false); $res->assertSee('导出对账明细(CSV)', false); $res->assertSee('导出含订单摘要(CSV)', false); + + // 导出链接应新开窗口,避免离开当前详情页 + $res->assertSee('target="_blank"', false); } }