From 0acf30c5ff44290f954759a1e5c4d8666177d8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 03:49:39 +0000 Subject: [PATCH] =?UTF-8?q?feat(gov):=20=E6=89=B9=E9=87=8F=E4=BB=85?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E7=94=9F=E6=95=88=E5=AE=A1=E8=AE=A1=E8=A1=A5?= =?UTF-8?q?=E5=85=85=20filters/note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Admin/PlatformOrderController.php | 11 +++++++++++ .../AdminPlatformOrderBatchMarkActivatedTest.php | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 17d98a6..fc50f1d 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -1001,6 +1001,15 @@ class PlatformOrderController extends Controller $success = 0; $nowStr = now()->toDateTimeString(); + // 筛选摘要:用于审计记录(便于追溯本次批量处理口径) + $filterSummaryParts = []; + foreach ($filters as $k => $v) { + if ((string) $v !== '') { + $filterSummaryParts[] = $k . '=' . (string) $v; + } + } + $filterSummary = implode('&', $filterSummaryParts); + foreach ($orders as $row) { $order = PlatformOrder::query()->find($row->id); if (! $order) { @@ -1022,6 +1031,8 @@ class PlatformOrderController extends Controller 'scope' => $scope, 'at' => $nowStr, 'admin_id' => $admin->id, + 'filters' => $filterSummary, + 'note' => '批量仅标记为已生效(limit=' . $limit . ', matched=' . $matchedTotal . ', processed=' . $processed . ')', ]; data_set($meta, 'audit', $audit); diff --git a/tests/Feature/AdminPlatformOrderBatchMarkActivatedTest.php b/tests/Feature/AdminPlatformOrderBatchMarkActivatedTest.php index 35893ce..9e50109 100644 --- a/tests/Feature/AdminPlatformOrderBatchMarkActivatedTest.php +++ b/tests/Feature/AdminPlatformOrderBatchMarkActivatedTest.php @@ -110,7 +110,10 @@ class AdminPlatformOrderBatchMarkActivatedTest extends TestCase $audit1 = (array) (data_get($o1->meta, 'audit', []) ?? []); $this->assertNotEmpty($audit1); - $this->assertSame('batch_mark_activated', (string) data_get(end($audit1), 'action')); + $last = end($audit1); + $this->assertSame('batch_mark_activated', (string) data_get($last, 'action')); + $this->assertNotEmpty(data_get($last, 'filters')); + $this->assertNotEmpty(data_get($last, 'note')); } public function test_batch_mark_activated_requires_paid_pending_filters_in_filtered_scope(): void