ui(platform-orders): render batch activation last_result summary

This commit is contained in:
萝卜
2026-03-17 13:01:02 +08:00
parent 82d68105de
commit f837c16bf5
2 changed files with 98 additions and 0 deletions

View File

@@ -1398,9 +1398,23 @@
$batchScope = (string) (data_get($batchActivation, 'scope') ?? '');
$batchScopeText = $batchScope === 'all' ? '全量' : ($batchScope === 'filtered' ? '筛选' : ($batchScope !== '' ? $batchScope : '-'));
@endphp
@php
$lastResult = (array) (data_get($batchActivation, 'last_result', []) ?? []);
$lrRunId = (string) (data_get($lastResult, 'run_id') ?? '');
$lrSuccess = (int) (data_get($lastResult, 'success') ?? 0);
$lrFailed = (int) (data_get($lastResult, 'failed') ?? 0);
$lrTopReason = (string) (data_get($lastResult, 'top_reasons.0.reason') ?? '');
$lrTopReasonCount = (int) (data_get($lastResult, 'top_reasons.0.count') ?? 0);
@endphp
<div>{{ $batchAt }}</div>
<div class="muted">管理员:{{ $batchAdminId ?: '-' }}</div>
<div class="muted muted-xs">范围:{{ $batchScopeText }};方式:{{ $batchModeText }}</div>
@if($lrRunId !== '')
<div class="muted muted-xs">结果:成功{{ $lrSuccess }} / 失败{{ $lrFailed }}</div>
@if($lrTopReason !== '')
<div class="muted muted-xs">Top{{ mb_substr($lrTopReason, 0, 40) }}{{ $lrTopReasonCount }}</div>
@endif
@endif
@else
<span class="muted">-</span>
@endif