platform_orders: add clear single sync_error action from show page
This commit is contained in:
@@ -1704,6 +1704,34 @@ class PlatformOrderController extends Controller
|
||||
return redirect()->back()->with('success', $msg);
|
||||
}
|
||||
|
||||
public function clearSyncError(Request $request, PlatformOrder $order): RedirectResponse
|
||||
{
|
||||
$admin = $this->ensurePlatformAdmin($request);
|
||||
|
||||
$meta = (array) ($order->meta ?? []);
|
||||
if (! data_get($meta, 'subscription_activation_error')) {
|
||||
return redirect()->back()->with('warning', '当前订单暂无同步失败标记,无需清理。');
|
||||
}
|
||||
|
||||
data_forget($meta, 'subscription_activation_error');
|
||||
|
||||
// 轻量审计:记录清理动作(不做独立表,先落 meta,便于排查)
|
||||
$audit = (array) (data_get($meta, 'audit', []) ?? []);
|
||||
$audit[] = [
|
||||
'action' => 'clear_sync_error',
|
||||
'scope' => 'single',
|
||||
'at' => now()->toDateTimeString(),
|
||||
'admin_id' => $admin->id,
|
||||
'note' => '手动点击订单详情【清除同步失败标记】',
|
||||
];
|
||||
data_set($meta, 'audit', $audit);
|
||||
|
||||
$order->meta = $meta;
|
||||
$order->save();
|
||||
|
||||
return redirect()->back()->with('success', '已清除该订单的同步失败标记。');
|
||||
}
|
||||
|
||||
public function clearSyncErrors(Request $request): RedirectResponse
|
||||
{
|
||||
$this->ensurePlatformAdmin($request);
|
||||
|
||||
Reference in New Issue
Block a user