From bc721c3adda35a321fdef0a296a7ea9b195164fa Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 9 Feb 2026 17:08:31 +0800 Subject: [PATCH] 1 --- app/common/service/SkuService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/common/service/SkuService.php b/app/common/service/SkuService.php index 73256b4..d9ebd80 100644 --- a/app/common/service/SkuService.php +++ b/app/common/service/SkuService.php @@ -6,6 +6,7 @@ use app\common\model\SkuAttributeValue; use app\common\validate\SkuValidate; use app\common\traits\crud\CrudServiceTrait; use app\common\model\Sku; +use support\exception\BusinessException; use support\Redis; use support\Request; @@ -84,6 +85,10 @@ class SkuService isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http'); $domain = $protocol . '://' . $request->host(); + if(!is_numeric($data['price'])){ + throw new BusinessException('价格不合法,需要是数字'); + } + $spec = []; foreach ($data['spec'] as $key => $value) { $specItem = [];