From 83de69c0818dde5286a0bcfa6ec8a6b82b0b3fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 03:11:54 +0000 Subject: [PATCH] =?UTF-8?q?feat(billing):=20=E4=BB=8E=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=88=9B=E5=BB=BA=E7=BB=AD=E8=B4=B9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=97=B6=E7=BB=91=E5=AE=9A=20site=5Fsubscription=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/PlatformOrderController.php | 3 +++ resources/views/admin/platform_orders/form.blade.php | 2 ++ resources/views/admin/site_subscriptions/show.blade.php | 1 + tests/Feature/AdminSiteSubscriptionShowTest.php | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) 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 + +