From c4c1eedce12f065ae93e1cb2415111350f91691f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Fri, 13 Mar 2026 21:02:25 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=B4=A6=E6=98=8E=E7=BB=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=EF=BC=9A=E5=A2=9E=E5=8A=A0=20exported=5Fat=20?= =?UTF-8?q?=E6=91=98=E8=A6=81=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/PlatformOrderController.php | 3 ++- tests/Feature/AdminPlatformOrderExportLedgerTest.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 654b9e0..3c9f5db 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -436,9 +436,10 @@ class PlatformOrderController extends Controller // UTF-8 BOM,避免 Excel 打开中文乱码 fwrite($out, "\xEF\xBB\xBF"); - // 订单摘要(基础两行) + // 订单摘要(基础三行) fputcsv($out, ['order_id', (string) $order->id]); fputcsv($out, ['order_no', (string) $order->order_no]); + fputcsv($out, ['exported_at', now()->format('Y-m-d H:i:s')]); // 可选:导出更多订单快照字段(便于财务/对账留档,不必另截图) if ($includeOrderSnapshot) { diff --git a/tests/Feature/AdminPlatformOrderExportLedgerTest.php b/tests/Feature/AdminPlatformOrderExportLedgerTest.php index 80bb5df..01a3c26 100644 --- a/tests/Feature/AdminPlatformOrderExportLedgerTest.php +++ b/tests/Feature/AdminPlatformOrderExportLedgerTest.php @@ -92,6 +92,10 @@ class AdminPlatformOrderExportLedgerTest extends TestCase $this->assertStringStartsWith("\xEF\xBB\xBF", $content); $this->assertStringStartsWith("\xEF\xBB\xBF", $content2); + // exported_at 摘要行 + $this->assertStringContainsString('exported_at,', $content); + $this->assertStringContainsString('exported_at,', $content2); + // 核心表头 $this->assertStringContainsString('record_type,receipt_type,channel,amount,biz_time,created_at,admin_id,note', $content); $this->assertStringContainsString('record_type,receipt_type,channel,amount,biz_time,created_at,admin_id,note', $content2);