refactor(admin): success flash payload提炼AdminFlash::success并复用
This commit is contained in:
@@ -1656,10 +1656,20 @@ class PlatformOrderController extends Controller
|
||||
(string) $runId,
|
||||
);
|
||||
|
||||
return redirect()->back()
|
||||
->with('success', '批量同步订阅任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ',run_id=' . $runId . ')。')
|
||||
->with('success_link_href', '/admin/platform-batches/show?type=bas&run_id=' . urlencode((string) $runId))
|
||||
->with('success_link_label', '进入批次复盘');
|
||||
$flash = \App\Support\AdminFlash::success(
|
||||
'批量同步订阅任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ',run_id=' . $runId . ')。',
|
||||
'/admin/platform-batches/show?type=bas&run_id=' . urlencode((string) $runId),
|
||||
'进入批次复盘',
|
||||
);
|
||||
|
||||
$res = redirect()->back()->with('success', (string) ($flash['success'] ?? ''));
|
||||
foreach (['success_link_href', 'success_link_label'] as $k) {
|
||||
if (isset($flash[$k]) && (string) $flash[$k] !== '') {
|
||||
$res = $res->with($k, (string) $flash[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function batchMarkPaidAndActivate(Request $request, SubscriptionActivationService $service): RedirectResponse
|
||||
@@ -1809,10 +1819,20 @@ class PlatformOrderController extends Controller
|
||||
(string) $runId,
|
||||
);
|
||||
|
||||
return redirect()->back()
|
||||
->with('success', '批量 BMPA 任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ',run_id=' . $runId . ')。')
|
||||
->with('success_link_href', '/admin/platform-batches/show?type=bmpa&run_id=' . urlencode((string) $runId))
|
||||
->with('success_link_label', '进入批次复盘');
|
||||
$flash = \App\Support\AdminFlash::success(
|
||||
'批量 BMPA 任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ',run_id=' . $runId . ')。',
|
||||
'/admin/platform-batches/show?type=bmpa&run_id=' . urlencode((string) $runId),
|
||||
'进入批次复盘',
|
||||
);
|
||||
|
||||
$res = redirect()->back()->with('success', (string) ($flash['success'] ?? ''));
|
||||
foreach (['success_link_href', 'success_link_label'] as $k) {
|
||||
if (isset($flash[$k]) && (string) $flash[$k] !== '') {
|
||||
$res = $res->with($k, (string) $flash[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function batchMarkActivated(Request $request): RedirectResponse
|
||||
@@ -2003,11 +2023,21 @@ class PlatformOrderController extends Controller
|
||||
$msg .= ';失败原因Top:' . $topText;
|
||||
}
|
||||
|
||||
return redirect()->back()
|
||||
->with('success', $msg)
|
||||
$flash = \App\Support\AdminFlash::success(
|
||||
$msg,
|
||||
// 批量“仅标记为已生效”无 run_id(同步执行),这里提供一个“查看本次批量结果”的快捷入口:最近24小时批量生效集合。
|
||||
->with('success_link_href', '/admin/platform-orders?batch_mark_activated_24h=1#filters')
|
||||
->with('success_link_label', '查看本次批量结果');
|
||||
'/admin/platform-orders?batch_mark_activated_24h=1#filters',
|
||||
'查看本次批量结果',
|
||||
);
|
||||
|
||||
$res = redirect()->back()->with('success', (string) ($flash['success'] ?? ''));
|
||||
foreach (['success_link_href', 'success_link_label'] as $k) {
|
||||
if (isset($flash[$k]) && (string) $flash[$k] !== '') {
|
||||
$res = $res->with($k, (string) $flash[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function clearSyncError(Request $request, PlatformOrder $order): RedirectResponse
|
||||
|
||||
Reference in New Issue
Block a user