feat(batch): add success governance links and filters for batch run review

This commit is contained in:
萝卜
2026-03-18 03:25:52 +08:00
parent 1550a0a650
commit f585256536
4 changed files with 111 additions and 3 deletions

View File

@@ -248,6 +248,8 @@ class PlatformOrderController extends Controller
'fail_only' => (string) $request->query('fail_only', ''),
// 只看批量“标记支付并生效”失败meta.batch_mark_paid_and_activate_error.message 存在
'bmpa_failed_only' => (string) $request->query('bmpa_failed_only', ''),
// 只看批量“标记支付并生效”成功:存在 run_id 且 error.message 为空
'bmpa_success_only' => (string) $request->query('bmpa_success_only', ''),
'synced_only' => (string) $request->query('synced_only', ''),
'sync_status' => trim((string) $request->query('sync_status', '')),
'keyword' => trim((string) $request->query('keyword', '')),
@@ -1315,6 +1317,8 @@ class PlatformOrderController extends Controller
'fail_only' => (string) $request->query('fail_only', ''),
// 只看批量“标记支付并生效”失败meta.batch_mark_paid_and_activate_error.message 存在
'bmpa_failed_only' => (string) $request->query('bmpa_failed_only', ''),
// 只看批量“标记支付并生效”成功:存在 run_id 且 error.message 为空
'bmpa_success_only' => (string) $request->query('bmpa_success_only', ''),
'synced_only' => (string) $request->query('synced_only', ''),
'sync_status' => trim((string) $request->query('sync_status', '')),
'keyword' => trim((string) $request->query('keyword', '')),
@@ -2316,6 +2320,12 @@ class PlatformOrderController extends Controller
// 只看批量“标记支付并生效”失败meta.batch_mark_paid_and_activate_error.message 存在即视为失败
$builder->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NOT NULL");
})
->when(($filters['bmpa_success_only'] ?? '') === '1', function (Builder $builder) {
// 只看批量“标记支付并生效”成功:存在 run_id 且 error.message 为空。
// 用途:从批次复盘页快速进入“本批次成功集合”(便于 spot-check 与抽样复核)。
$builder->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate.run_id') IS NOT NULL")
->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NULL");
})
->when(($filters['synced_only'] ?? '') !== '', function (Builder $builder) {
// 只看已同步meta.subscription_activation.subscription_id 存在即视为已同步
$builder->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NOT NULL");