@extends('admin.layouts.app') @section('title', '批次详情') @section('page_title', '批次详情') @section('content') @php $typeText = $type === 'bas' ? 'BAS(批量同步订阅)' : ($type === 'bmpa' ? 'BMPA(批量标记支付并生效)' : '未知'); $selfWithoutBack = \App\Support\BackUrl::selfWithoutBack(); $backToListUrl = $safeBackForLinks !== '' ? $safeBackForLinks : '/admin/platform-orders'; $hasSummary = $summary !== null; $success = (int) (data_get($summary, 'success') ?? 0); $failed = (int) (data_get($summary, 'failed') ?? 0); $matched = (int) (data_get($summary, 'matched') ?? 0); $processed = (int) (data_get($summary, 'processed') ?? 0); $at = (string) (data_get($summary, 'at') ?? ''); $topReasons = (array) (data_get($summary, 'top_reasons', []) ?? []); $fallbackMatched = (int) (data_get($fallbackCounts, 'matched') ?? 0); $fallbackFailed = (int) (data_get($fallbackCounts, 'failed') ?? 0); @endphp

{{ $typeText }} 批次详情

run_id:{{ $runId ?: '-' }}
@if($at !== '')
更新时间:{{ $at }}
@endif
@if(($error ?? '') !== '')
{{ $error }}
@else @if(! $hasSummary)
本批次尚未生成 last_result 汇总(可能队列任务仍在执行,或历史数据未补齐)。 当前页面展示的是基于同批次订单的粗略统计,供运营先行定位。
@endif

命中

{{ $hasSummary ? $matched : $fallbackMatched }}

本次处理

{{ $hasSummary ? $processed : '-' }}

成功 / 失败

{{ $hasSummary ? ($success . ' / ' . $failed) : ('- / ' . $fallbackFailed) }}

一键治理入口

说明:当前批次为“冗余写入到每条订单 meta.last_result”的模式;后续可演进为独立批次表。

Top 失败原因

@if(! $hasSummary)
暂无(last_result 未写入时不做原因聚合,以免在页面侧引入重查询)。
@elseif(count($topReasons) === 0)
暂无。
@else @foreach($topReasons as $r) @endforeach
原因 次数
{{ (string) (data_get($r, 'reason') ?? '-') }} {{ (int) (data_get($r, 'count') ?? 0) }}
@endif
@endif @endsection