diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 6928e15..9c1e91d 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -31,6 +31,7 @@ class PlatformOrderController extends Controller $defaults = [ 'merchant_id' => (int) $request->query('merchant_id', 0), 'plan_id' => (int) $request->query('plan_id', 0), + 'site_subscription_id' => (int) $request->query('site_subscription_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), @@ -54,6 +55,7 @@ class PlatformOrderController extends Controller $data = $request->validate([ 'merchant_id' => ['required', 'integer', 'exists:merchants,id'], 'plan_id' => ['required', 'integer', 'exists:plans,id'], + 'site_subscription_id' => ['nullable', 'integer', 'exists:site_subscriptions,id'], 'order_type' => ['required', Rule::in(array_keys($this->orderTypeLabels()))], 'quantity' => ['required', 'integer', 'min:1', 'max:120'], 'discount_amount' => ['nullable', 'numeric', 'min:0'], @@ -80,6 +82,7 @@ class PlatformOrderController extends Controller $order = PlatformOrder::query()->create([ 'merchant_id' => (int) $data['merchant_id'], 'plan_id' => $plan->id, + 'site_subscription_id' => (int) ($data['site_subscription_id'] ?? 0) ?: null, 'created_by_admin_id' => $admin->id, 'order_no' => $orderNo, 'order_type' => (string) $data['order_type'], diff --git a/resources/views/admin/platform_orders/form.blade.php b/resources/views/admin/platform_orders/form.blade.php index 5cb8ecb..f2d202d 100644 --- a/resources/views/admin/platform_orders/form.blade.php +++ b/resources/views/admin/platform_orders/form.blade.php @@ -12,6 +12,8 @@
@csrf + +