Files
saasshop/resources/views/admin/platform_batches/show.blade.php

106 lines
4.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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';
$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', []) ?? []);
@endphp
<div class="card mb-20">
<div class="actions-spread">
<div>
<h2 class="mb-6">{{ $typeText }} 批次详情</h2>
<div class="muted">run_id<strong>{{ $runId ?: '-' }}</strong></div>
@if($at !== '')
<div class="muted muted-xs">更新时间:{{ $at }}</div>
@endif
</div>
<div class="actions gap-10">
<a class="btn btn-secondary btn-sm" href="{{ $backToListUrl }}">返回上一页</a>
<a class="btn btn-secondary btn-sm" href="/admin/platform-batches/show?type={{ $type }}&run_id={{ urlencode($runId) }}&back={{ urlencode($selfWithoutBack) }}">刷新</a>
</div>
</div>
</div>
@if(($error ?? '') !== '')
<div class="warning">{{ $error }}</div>
@else
<div class="grid-3 mb-20">
<div class="card">
<h3>命中</h3>
<div class="metric-number">{{ $matched }}</div>
</div>
<div class="card">
<h3>本次处理</h3>
<div class="metric-number">{{ $processed }}</div>
</div>
<div class="card">
<h3>成功 / 失败</h3>
<div class="metric-number">{{ $success }} / {{ $failed }}</div>
</div>
</div>
<div class="card mb-20">
<h3>一键治理入口</h3>
<div class="inline-links">
@if(($governanceLinks['all'] ?? '') !== '')
<a class="link" href="{{ $governanceLinks['all'] }}">本批次全部</a>
@endif
@if(($governanceLinks['failed'] ?? '') !== '')
<span class="muted"></span>
<a class="link" href="{{ $governanceLinks['failed'] }}">本批次失败</a>
@endif
@if(($governanceLinks['top_reason'] ?? '') !== '')
<span class="muted"></span>
<a class="link" href="{{ $governanceLinks['top_reason'] }}">按Top原因</a>
@endif
@if(($governanceLinks['retry_syncable'] ?? '') !== '')
<span class="muted"></span>
<a class="link" href="{{ $governanceLinks['retry_syncable'] }}">本批次可同步重试</a>
@endif
@if(($governanceLinks['retry_processable'] ?? '') !== '')
<span class="muted"></span>
<a class="link" href="{{ $governanceLinks['retry_processable'] }}">本批次可再次尝试pending+unpaid</a>
@endif
</div>
<div class="muted muted-xs mt-6">说明:当前批次为“冗余写入到每条订单 meta.last_result”的模式后续可演进为独立批次表。</div>
</div>
<div class="card">
<h3>Top 失败原因</h3>
@if(count($topReasons) === 0)
<div class="muted">暂无(或尚未写入 last_result</div>
@else
<table class="table">
<thead>
<tr>
<th>原因</th>
<th style="width: 120px;">次数</th>
</tr>
</thead>
<tbody>
@foreach($topReasons as $r)
<tr>
<td>{{ (string) (data_get($r, 'reason') ?? '-') }}</td>
<td>{{ (int) (data_get($r, 'count') ?? 0) }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
@endif
@endsection