From 196fec3120368905baecd6c6f5bd2af61f43f4b4 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Thu, 5 Feb 2026 16:13:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(product):=20=E4=BF=AE=E6=AD=A3=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=99=A8=E9=82=8F=E8=BC=AF=E4=B8=A6=E5=BE=B9=E5=BA=95?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=95=86=E5=93=81=E8=B5=B7=E5=81=9C=E7=94=A8?= =?UTF-8?q?=E9=96=8B=E9=97=9C=EF=BC=8C=E7=B5=B1=E4=B8=80=E8=A8=AD=E7=82=BA?= =?UTF-8?q?=E5=95=9F=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Modules/Inventory/Controllers/ProductController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Modules/Inventory/Controllers/ProductController.php b/app/Modules/Inventory/Controllers/ProductController.php index 8d0abba..2bdca4e 100644 --- a/app/Modules/Inventory/Controllers/ProductController.php +++ b/app/Modules/Inventory/Controllers/ProductController.php @@ -188,9 +188,10 @@ class ProductController extends Controller 'price' => 'nullable|numeric|min:0', 'member_price' => 'nullable|numeric|min:0', 'wholesale_price' => 'nullable|numeric|min:0', - 'is_active' => 'boolean', ]); + $validated['is_active'] = true; + if (empty($validated['code'])) { $validated['code'] = $this->generateRandomCode(); } @@ -250,9 +251,10 @@ class ProductController extends Controller 'price' => 'nullable|numeric|min:0', 'member_price' => 'nullable|numeric|min:0', 'wholesale_price' => 'nullable|numeric|min:0', - 'is_active' => 'boolean', ]); + $validated['is_active'] = true; + if (empty($validated['code'])) { $validated['code'] = $this->generateRandomCode(); }