feat(product): 修正控制器邏輯並徹底移除商品起停用開關,統一設為啟用

This commit is contained in:
2026-02-05 16:13:24 +08:00
parent 096a114457
commit 196fec3120

View File

@@ -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();
}