refactor(admin): AdminFlash增加apply并在批量动作成功提示复用
This commit is contained in:
@@ -1662,14 +1662,7 @@ class PlatformOrderController extends Controller
|
||||
'进入批次复盘',
|
||||
);
|
||||
|
||||
$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;
|
||||
return \App\Support\AdminFlash::apply(redirect()->back(), $flash);
|
||||
}
|
||||
|
||||
public function batchMarkPaidAndActivate(Request $request, SubscriptionActivationService $service): RedirectResponse
|
||||
@@ -1825,14 +1818,7 @@ class PlatformOrderController extends Controller
|
||||
'进入批次复盘',
|
||||
);
|
||||
|
||||
$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;
|
||||
return \App\Support\AdminFlash::apply(redirect()->back(), $flash);
|
||||
}
|
||||
|
||||
public function batchMarkActivated(Request $request): RedirectResponse
|
||||
@@ -2030,14 +2016,7 @@ class PlatformOrderController extends Controller
|
||||
'查看本次批量结果',
|
||||
);
|
||||
|
||||
$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;
|
||||
return \App\Support\AdminFlash::apply(redirect()->back(), $flash);
|
||||
}
|
||||
|
||||
public function clearSyncError(Request $request, PlatformOrder $order): RedirectResponse
|
||||
|
||||
Reference in New Issue
Block a user