chore: init saasshop repo + sql migrations runner + gitee go
This commit is contained in:
298
resources/views/admin/platform_orders/index.blade.php
Normal file
298
resources/views/admin/platform_orders/index.blade.php
Normal file
@@ -0,0 +1,298 @@
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('title', '平台订单')
|
||||
@section('page_title', '平台订单')
|
||||
|
||||
@section('content')
|
||||
<div class="card mb-20">
|
||||
<p class="muted muted-tight">这里是总台视角的平台收费主链骨架页,当前阶段先承接套餐订购 / 续费 / 生效跟踪。</p>
|
||||
<p class="muted">本页先提供可访问列表、基础筛选与摘要卡,后续再补详情、导出、支付记录与退款轨迹。</p>
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>筛选条件</h3>
|
||||
<form method="get" action="/admin/platform-orders" class="grid-3">
|
||||
<select name="status">
|
||||
<option value="">全部订单状态</option>
|
||||
@foreach(($filterOptions['statuses'] ?? []) as $value => $label)
|
||||
<option value="{{ $value }}" @selected(($filters['status'] ?? '') === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<select name="payment_status">
|
||||
<option value="">全部支付状态</option>
|
||||
@foreach(($filterOptions['paymentStatuses'] ?? []) as $value => $label)
|
||||
<option value="{{ $value }}" @selected(($filters['payment_status'] ?? '') === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<select name="sync_status">
|
||||
<option value="">全部同步状态</option>
|
||||
<option value="unsynced" @selected(($filters['sync_status'] ?? '') === 'unsynced')>未同步</option>
|
||||
<option value="synced" @selected(($filters['sync_status'] ?? '') === 'synced')>已同步</option>
|
||||
<option value="failed" @selected(($filters['sync_status'] ?? '') === 'failed')>同步失败</option>
|
||||
</select>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="fail_only" value="1" @checked(($filters['fail_only'] ?? '') === '1')>
|
||||
<span>只看同步失败</span>
|
||||
</label>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="synced_only" value="1" @checked(($filters['synced_only'] ?? '') === '1')>
|
||||
<span>只看已同步</span>
|
||||
</label>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="syncable_only" value="1" @checked(($filters['syncable_only'] ?? '') === '1')>
|
||||
<span>只看可同步</span>
|
||||
</label>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="batch_synced_24h" value="1" @checked(($filters['batch_synced_24h'] ?? '') === '1')>
|
||||
<span>最近24小时批量同步过</span>
|
||||
</label>
|
||||
<div>
|
||||
<button type="submit">应用筛选</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="grid-3 mb-20">
|
||||
<div class="card">
|
||||
<h3>平台订单总数</h3>
|
||||
<div class="metric-number">{{ $summaryStats['total_orders'] ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>已支付 / 已生效</h3>
|
||||
<div class="metric-number">{{ $summaryStats['paid_orders'] ?? 0 }} / {{ $summaryStats['activated_orders'] ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>已同步 / 未同步</h3>
|
||||
<div class="metric-number">{{ $summaryStats['synced_orders'] ?? 0 }} / {{ $summaryStats['unsynced_orders'] ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>同步失败数</h3>
|
||||
<div class="metric-number">{{ $summaryStats['failed_sync_orders'] ?? 0 }}</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>同步失败原因 TOP5</h3>
|
||||
@php $failedReasonStats = $failedReasonStats ?? []; @endphp
|
||||
@if(count($failedReasonStats) > 0)
|
||||
<div class="muted mt-6">
|
||||
@foreach($failedReasonStats as $item)
|
||||
<div>{{ $item['reason'] }} <span class="muted">({{ $item['count'] }})</span></div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<div class="muted">暂无失败原因聚合数据</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>工具</h3>
|
||||
<div class="muted mb-10">清除仅影响订单 meta 中的失败标记,不改变订单/订阅状态。</div>
|
||||
|
||||
<form method="get" action="/admin/platform-orders/export" class="mb-10">
|
||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
||||
<input type="hidden" name="payment_status" value="{{ $filters['payment_status'] ?? '' }}">
|
||||
<input type="hidden" name="fail_only" value="{{ $filters['fail_only'] ?? '' }}">
|
||||
<input type="hidden" name="synced_only" value="{{ $filters['synced_only'] ?? '' }}">
|
||||
<input type="hidden" name="sync_status" value="{{ $filters['sync_status'] ?? '' }}">
|
||||
<input type="hidden" name="syncable_only" value="{{ $filters['syncable_only'] ?? '' }}">
|
||||
<input type="hidden" name="batch_synced_24h" value="{{ $filters['batch_synced_24h'] ?? '' }}">
|
||||
|
||||
<label class="form-inline-row mb-8">
|
||||
<input type="checkbox" name="include_meta" value="1">
|
||||
<span>包含原始 meta(JSON)(用于排障)</span>
|
||||
</label>
|
||||
|
||||
<button type="submit">导出当前筛选结果(CSV)</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/batch-activate-subscriptions" onsubmit="return confirm('确认批量同步当前筛选范围内“可同步”的订单?(仅处理:已支付+已生效+未同步)');" class="mb-10">
|
||||
@csrf
|
||||
<input type="hidden" name="scope" value="filtered">
|
||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
||||
<input type="hidden" name="payment_status" value="{{ $filters['payment_status'] ?? '' }}">
|
||||
<input type="hidden" name="fail_only" value="{{ $filters['fail_only'] ?? '' }}">
|
||||
<input type="hidden" name="synced_only" value="{{ $filters['synced_only'] ?? '' }}">
|
||||
<input type="hidden" name="sync_status" value="{{ $filters['sync_status'] ?? '' }}">
|
||||
<input type="hidden" name="syncable_only" value="{{ $filters['syncable_only'] ?? '' }}">
|
||||
<input type="hidden" name="batch_synced_24h" value="{{ $filters['batch_synced_24h'] ?? '' }}">
|
||||
|
||||
<label class="muted form-inline-row mb-8">
|
||||
<span>本次最多处理</span>
|
||||
<input type="number" name="limit" value="50" min="1" max="500" class="w-90">
|
||||
<span>条(安全阀)</span>
|
||||
</label>
|
||||
|
||||
<div class="muted mb-8">提示:建议先勾选筛选条件「只看可同步」,再执行批量同步。</div>
|
||||
<button type="submit">批量同步订阅(当前筛选范围)</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/batch-activate-subscriptions" onsubmit="return confirm('确认对全部订单执行批量同步?该操作仍只处理“已支付+已生效+未同步”的订单,但范围可能很大。');" class="mb-10">
|
||||
@csrf
|
||||
<input type="hidden" name="scope" value="all">
|
||||
<label class="muted form-inline-row mb-8">
|
||||
<span>确认输入</span>
|
||||
<input type="text" name="confirm" placeholder="YES" class="w-140">
|
||||
<span>(必须输入 YES 才会执行)</span>
|
||||
</label>
|
||||
<label class="muted form-inline-row mb-8">
|
||||
<span>本次最多处理</span>
|
||||
<input type="number" name="limit" value="50" min="1" max="500" class="w-90">
|
||||
<span>条(安全阀)</span>
|
||||
</label>
|
||||
<button type="submit">批量同步订阅(全部订单)</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/clear-sync-errors" onsubmit="return confirm('确认清除当前筛选范围内命中的订单的“同步失败”标记?');" class="mb-10">
|
||||
@csrf
|
||||
<input type="hidden" name="scope" value="filtered">
|
||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
||||
<input type="hidden" name="payment_status" value="{{ $filters['payment_status'] ?? '' }}">
|
||||
<input type="hidden" name="fail_only" value="{{ $filters['fail_only'] ?? '' }}">
|
||||
<input type="hidden" name="synced_only" value="{{ $filters['synced_only'] ?? '' }}">
|
||||
<input type="hidden" name="sync_status" value="{{ $filters['sync_status'] ?? '' }}">
|
||||
<input type="hidden" name="syncable_only" value="{{ $filters['syncable_only'] ?? '' }}">
|
||||
<input type="hidden" name="batch_synced_24h" value="{{ $filters['batch_synced_24h'] ?? '' }}">
|
||||
<button type="submit">清除当前筛选范围的失败标记</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/clear-sync-errors" onsubmit="return confirm('确认清除全部订单的“同步失败”标记?');">
|
||||
@csrf
|
||||
<input type="hidden" name="scope" value="all">
|
||||
<button type="submit">清除全部失败标记</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>平台订单列表</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>订单号</th>
|
||||
<th>站点</th>
|
||||
<th>套餐</th>
|
||||
<th>订单类型</th>
|
||||
<th>订单状态</th>
|
||||
<th>支付状态</th>
|
||||
<th>应付金额</th>
|
||||
<th>已付金额</th>
|
||||
<th>下单时间</th>
|
||||
<th>支付时间</th>
|
||||
<th>同步状态</th>
|
||||
<th>订阅号</th>
|
||||
<th>订阅到期</th>
|
||||
<th>同步时间</th>
|
||||
<th>最近批量同步</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($orders as $order)
|
||||
<tr>
|
||||
<td>{{ $order->id }}</td>
|
||||
<td><a href="/admin/platform-orders/{{ $order->id }}">{{ $order->order_no }}</a></td>
|
||||
<td>{{ $order->merchant?->name ?? '未关联站点' }}</td>
|
||||
<td>{{ $order->plan_name ?: ($order->plan?->name ?? '未设置') }}</td>
|
||||
<td>{{ $order->order_type }}</td>
|
||||
<td>
|
||||
{{ $statusLabels[$order->status] ?? $order->status }}
|
||||
<div class="muted">{{ $order->status }}</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }}
|
||||
<div class="muted">{{ $order->payment_status }}</div>
|
||||
</td>
|
||||
<td>¥{{ number_format((float) $order->payable_amount, 2) }}</td>
|
||||
<td>¥{{ number_format((float) $order->paid_amount, 2) }}</td>
|
||||
<td>{{ optional($order->placed_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
|
||||
<td>{{ optional($order->paid_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
|
||||
<td>
|
||||
@php
|
||||
$syncedId = (int) data_get($order->meta, 'subscription_activation.subscription_id', 0);
|
||||
$syncErr = (string) (data_get($order->meta, 'subscription_activation_error.message') ?? '');
|
||||
@endphp
|
||||
@if($syncedId > 0)
|
||||
<span>已同步</span>
|
||||
@elseif($syncErr !== '')
|
||||
<span class="text-danger">同步失败</span>
|
||||
@else
|
||||
<span class="muted">未同步</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $order->siteSubscription?->subscription_no ?: '-' }}</td>
|
||||
<td>{{ optional($order->siteSubscription?->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
|
||||
<td>{{ data_get($order->meta, 'subscription_activation.synced_at') ?: '-' }}</td>
|
||||
<td>
|
||||
@php
|
||||
// 优先使用扁平字段 meta.batch_activation(便于筛选/统计,也避免遍历 audit)
|
||||
$batchActivation = (array) (data_get($order->meta, 'batch_activation', []) ?? []);
|
||||
$batchAt = (string) (data_get($batchActivation, 'at') ?? '');
|
||||
$batchAdminId = data_get($batchActivation, 'admin_id');
|
||||
|
||||
// 兼容旧数据:若尚未写入 batch_activation,则回退从 meta.audit[] 中取最近一次批量同步记录
|
||||
$audit = (array) (data_get($order->meta, 'audit', []) ?? []);
|
||||
$lastBatch = null;
|
||||
if ($batchAt === '' && count($audit) > 0) {
|
||||
foreach (array_reverse($audit) as $item) {
|
||||
if ((string) data_get($item, 'action') === 'batch_activate_subscription') {
|
||||
$lastBatch = $item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($batchAt === '' && $lastBatch) {
|
||||
$batchAt = (string) (data_get($lastBatch, 'at') ?? '');
|
||||
$batchAdminId = data_get($lastBatch, 'admin_id');
|
||||
}
|
||||
@endphp
|
||||
@if($batchAt !== '')
|
||||
<div>{{ $batchAt }}</div>
|
||||
<div class="muted">管理员:{{ $batchAdminId ?: '-' }}</div>
|
||||
@else
|
||||
<span class="muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$canActivate = ($order->payment_status === 'paid') && ($order->status === 'activated');
|
||||
$alreadySynced = (int) data_get($order->meta, 'subscription_activation.subscription_id', 0) > 0;
|
||||
$syncError = data_get($order->meta, 'subscription_activation_error.message');
|
||||
$syncErrorAt = data_get($order->meta, 'subscription_activation_error.at');
|
||||
@endphp
|
||||
@php
|
||||
$canMarkPaid = ($order->payment_status !== 'paid') || ($order->status !== 'activated');
|
||||
@endphp
|
||||
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/mark-paid-and-activate" onsubmit="return confirm('确认将该订单标记为已支付并生效?此操作会推进状态并尝试同步订阅');" class="mb-6">
|
||||
@csrf
|
||||
<button type="submit" @disabled(! $canMarkPaid)>标记支付并生效</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
||||
@csrf
|
||||
<button type="submit" @disabled(! $canActivate || $alreadySynced)>{{ $alreadySynced ? '已同步' : '同步订阅' }}</button>
|
||||
</form>
|
||||
|
||||
@if(! $canActivate)
|
||||
<div class="muted mt-6">需已支付且订单状态为已生效</div>
|
||||
@elseif($alreadySynced)
|
||||
<div class="muted mt-6">该订单已完成同步(幂等保护)</div>
|
||||
@endif
|
||||
|
||||
@if($syncError)
|
||||
<div class="muted text-danger mt-6">同步失败:{{ $syncError }}{{ $syncErrorAt ? '(' . $syncErrorAt . ')' : '' }}</div>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="17" class="muted">暂无平台订单,当前阶段骨架已就位,可继续补套餐下单、支付回执与订阅生效链路。</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination-wrap">{{ $orders->links() }}</div>
|
||||
@endsection
|
||||
158
resources/views/admin/platform_orders/show.blade.php
Normal file
158
resources/views/admin/platform_orders/show.blade.php
Normal file
@@ -0,0 +1,158 @@
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('title', '平台订单详情')
|
||||
@section('page_title', '平台订单详情')
|
||||
|
||||
@section('content')
|
||||
<div class="card mb-20">
|
||||
<p class="muted muted-tight">这里用于运营排查:订单核心字段、关联订阅、以及订阅同步元数据(meta)。</p>
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>订单信息</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th style="width:160px;">ID</th><td>{{ $order->id }}</td></tr>
|
||||
<tr><th>订单号</th><td>{{ $order->order_no }}</td></tr>
|
||||
<tr><th>站点</th><td>{{ $order->merchant?->name ?? '未关联站点' }}</td></tr>
|
||||
<tr><th>套餐</th><td>{{ $order->plan_name ?: ($order->plan?->name ?? '-') }}</td></tr>
|
||||
<tr><th>订单类型</th><td>{{ $order->order_type }}</td></tr>
|
||||
<tr><th>订单状态</th><td>{{ $statusLabels[$order->status] ?? $order->status }} <span class="muted">({{ $order->status }})</span></td></tr>
|
||||
<tr><th>支付状态</th><td>{{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }} <span class="muted">({{ $order->payment_status }})</span></td></tr>
|
||||
<tr><th>应付/已付</th><td>¥{{ number_format((float) $order->payable_amount, 2) }} / ¥{{ number_format((float) $order->paid_amount, 2) }}</td></tr>
|
||||
<tr><th>下单时间</th><td>{{ optional($order->placed_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
|
||||
<tr><th>支付时间</th><td>{{ optional($order->paid_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
|
||||
<tr><th>生效时间</th><td>{{ optional($order->activated_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@php
|
||||
$canActivate = ($order->payment_status === 'paid') && ($order->status === 'activated');
|
||||
$alreadySynced = (int) data_get($order->meta, 'subscription_activation.subscription_id', 0) > 0;
|
||||
$canMarkPaid = ($order->payment_status !== 'paid') || ($order->status !== 'activated');
|
||||
$syncError = data_get($order->meta, 'subscription_activation_error.message');
|
||||
$syncErrorAt = data_get($order->meta, 'subscription_activation_error.at');
|
||||
@endphp
|
||||
|
||||
<div style="margin-top:16px; display:flex; gap:12px; flex-wrap:wrap;">
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/mark-paid-and-activate" onsubmit="return confirm('确认将该订单标记为已支付并生效?此操作会推进状态并尝试同步订阅');">
|
||||
@csrf
|
||||
<button type="submit" @disabled(! $canMarkPaid)>标记支付并生效</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
||||
@csrf
|
||||
<button type="submit" @disabled(! $canActivate || $alreadySynced)>{{ $alreadySynced ? '已同步' : '同步订阅' }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@if(! $canActivate)
|
||||
<div class="muted" style="margin-top:10px;">同步订阅需满足:已支付 + 订单状态已生效</div>
|
||||
@elseif($alreadySynced)
|
||||
<div class="muted" style="margin-top:10px;">该订单已完成同步(幂等保护)</div>
|
||||
@endif
|
||||
|
||||
@if($syncError)
|
||||
<div class="muted" style="margin-top:10px; color:#b42318;">最近同步失败:{{ $syncError }}{{ $syncErrorAt ? '(' . $syncErrorAt . ')' : '' }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>关联订阅</h3>
|
||||
@if($order->siteSubscription)
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th style="width:160px;">订阅ID</th><td>{{ $order->siteSubscription->id }}</td></tr>
|
||||
<tr><th>订阅号</th><td>{{ $order->siteSubscription->subscription_no }}</td></tr>
|
||||
<tr><th>订阅管理</th><td><a href="/admin/site-subscriptions?keyword={{ urlencode($order->siteSubscription->subscription_no) }}">打开订阅管理(按订阅号筛选)</a></td></tr>
|
||||
<tr><th>状态</th><td>{{ $order->siteSubscription->status }}</td></tr>
|
||||
<tr><th>开始/到期</th><td>{{ optional($order->siteSubscription->starts_at)->format('Y-m-d H:i:s') ?: '-' }} / {{ optional($order->siteSubscription->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p class="muted">该订单尚未关联订阅(site_subscription_id 为空)。</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@php
|
||||
$activation = data_get($order->meta, 'subscription_activation');
|
||||
$activationError = data_get($order->meta, 'subscription_activation_error');
|
||||
$audit = (array) (data_get($order->meta, 'audit', []) ?? []);
|
||||
@endphp
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>订阅同步记录</h3>
|
||||
@if($activation)
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th style="width:160px;">订阅ID</th><td>{{ data_get($activation, 'subscription_id') }}</td></tr>
|
||||
<tr><th>同步时间</th><td>{{ data_get($activation, 'synced_at') ?: '-' }}</td></tr>
|
||||
<tr><th>操作管理员</th><td>{{ data_get($activation, 'admin_id') ?: '-' }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p class="muted">暂无同步记录。</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>最近一次同步失败</h3>
|
||||
@if($activationError)
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th style="width:160px;">失败原因</th><td>{{ data_get($activationError, 'message') }}</td></tr>
|
||||
<tr><th>失败时间</th><td>{{ data_get($activationError, 'at') ?: '-' }}</td></tr>
|
||||
<tr><th>操作管理员</th><td>{{ data_get($activationError, 'admin_id') ?: '-' }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p class="muted">暂无失败记录。</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card mb-20">
|
||||
<h3>审计记录(最近 20 条)</h3>
|
||||
@if(count($audit) > 0)
|
||||
@php
|
||||
$auditItems = array_slice(array_reverse($audit), 0, 20);
|
||||
$auditActionLabels = [
|
||||
'clear_sync_error' => '清除同步失败标记',
|
||||
'batch_activate_subscription' => '批量同步订阅',
|
||||
];
|
||||
@endphp
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:180px;">动作</th>
|
||||
<th style="width:120px;">范围</th>
|
||||
<th style="width:200px;">时间</th>
|
||||
<th style="width:100px;">管理员</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($auditItems as $item)
|
||||
<tr>
|
||||
<td>{{ $auditActionLabels[data_get($item, 'action')] ?? (data_get($item, 'action') ?: '-') }}</td>
|
||||
<td>{{ data_get($item, 'scope') ?: '-' }}</td>
|
||||
<td>{{ data_get($item, 'at') ?: '-' }}</td>
|
||||
<td>{{ data_get($item, 'admin_id') ?: '-' }}</td>
|
||||
<td class="muted">{{ data_get($item, 'note') ?: '' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p class="muted">暂无审计记录。</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>原始 meta(JSON)</h3>
|
||||
<pre style="white-space: pre-wrap;">{{ json_encode($order->meta, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
|
||||
</div>
|
||||
|
||||
<div class="mb-20" style="margin-top:16px;">
|
||||
<a href="/admin/platform-orders">← 返回平台订单列表</a>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user