diff --git a/app/Http/Controllers/Admin/PlatformBatchController.php b/app/Http/Controllers/Admin/PlatformBatchController.php index 5b11242..991a109 100644 --- a/app/Http/Controllers/Admin/PlatformBatchController.php +++ b/app/Http/Controllers/Admin/PlatformBatchController.php @@ -93,7 +93,7 @@ class PlatformBatchController extends Controller ]; } - // 治理入口:全部/失败/按Top原因/可重试 + // 治理入口:全部/成功/失败/按Top原因/可重试 $governanceLinks = []; if ($type === 'bas') { @@ -101,6 +101,11 @@ class PlatformBatchController extends Controller 'batch_activation_run_id' => $runId, ]), $safeBackForLinks, 'filters'); + $governanceLinks['success'] = BackUrl::withBackAndFragment('/admin/platform-orders?' . \Illuminate\Support\Arr::query([ + 'batch_activation_run_id' => $runId, + 'sync_status' => 'synced', + ]), $safeBackForLinks, 'filters'); + $governanceLinks['failed'] = BackUrl::withBackAndFragment('/admin/platform-orders?' . \Illuminate\Support\Arr::query([ 'batch_activation_run_id' => $runId, 'sync_status' => 'failed', @@ -129,6 +134,11 @@ class PlatformBatchController extends Controller 'batch_bmpa_run_id' => $runId, ]), $safeBackForLinks, 'filters'); + $governanceLinks['success'] = BackUrl::withBackAndFragment('/admin/platform-orders?' . \Illuminate\Support\Arr::query([ + 'batch_bmpa_run_id' => $runId, + 'bmpa_success_only' => '1', + ]), $safeBackForLinks, 'filters'); + $governanceLinks['failed'] = BackUrl::withBackAndFragment('/admin/platform-orders?' . \Illuminate\Support\Arr::query([ 'batch_bmpa_run_id' => $runId, 'bmpa_failed_only' => '1', diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 15c7d34..1e28f09 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -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"); diff --git a/resources/views/admin/platform_batches/show.blade.php b/resources/views/admin/platform_batches/show.blade.php index c2a001c..37ce5a1 100644 --- a/resources/views/admin/platform_batches/show.blade.php +++ b/resources/views/admin/platform_batches/show.blade.php @@ -84,10 +84,14 @@