feat(gov): 批量仅标记生效审计补充 filters/note
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user