Platform batch show: add spot-check next link

This commit is contained in:
萝卜
2026-03-18 09:22:28 +08:00
parent 548d2b8bb8
commit 96a686f71e
3 changed files with 144 additions and 0 deletions

View File

@@ -25,6 +25,9 @@ class PlatformBatchController extends Controller
$incomingBack = (string) $request->query('back', '');
$safeBackForLinks = BackUrl::sanitizeForLinks($incomingBack);
// 抽样复核:换一单(用 id 游标避免随机导致测试不稳定)
$spotAfterId = (int) $request->query('spot_after_id', 0);
if ($type === '' || $runId === '') {
return view('admin.platform_batches.show', [
'type' => $type,
@@ -190,6 +193,10 @@ class PlatformBatchController extends Controller
$sampleQuery->whereRaw("JSON_UNQUOTE(JSON_EXTRACT(meta, '{$keyPrefix}.run_id')) = ?", [$runId]);
}
if ($spotAfterId > 0) {
$sampleQuery->where('id', '<', $spotAfterId);
}
if ($type === 'bas') {
$sampleQuery->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NOT NULL")
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL");