feat(subscriptions): 订阅详情支持一键创建续费订单

This commit is contained in:
萝卜
2026-03-10 14:46:16 +00:00
parent 3f809c8150
commit 6ebd3510db
4 changed files with 23 additions and 8 deletions

View File

@@ -27,11 +27,23 @@ class PlatformOrderController extends Controller
$merchants = Merchant::query()->orderBy('id')->get(['id', 'name']);
$plans = Plan::query()->orderBy('sort')->orderByDesc('id')->get();
// 支持从其它页面(例如订阅详情)带默认值跳转过来,提高运营效率
$defaults = [
'merchant_id' => (int) $request->query('merchant_id', 0),
'plan_id' => (int) $request->query('plan_id', 0),
'order_type' => (string) $request->query('order_type', 'new_purchase'),
'quantity' => (int) $request->query('quantity', 1),
'discount_amount' => (float) $request->query('discount_amount', 0),
'payment_channel' => (string) $request->query('payment_channel', ''),
'remark' => (string) $request->query('remark', ''),
];
return view('admin.platform_orders.form', [
'merchants' => $merchants,
'plans' => $plans,
'billingCycleLabels' => $this->billingCycleLabels(),
'orderTypeLabels' => $this->orderTypeLabels(),
'defaults' => $defaults,
]);
}