对账明细导出:增加 exported_at 摘要行

This commit is contained in:
萝卜
2026-03-13 21:02:25 +00:00
parent 2a8a521dc0
commit c4c1eedce1
2 changed files with 6 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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);