From 07edf3f8e49dc61e6f6c67dc74c8baead5fd825a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 7 Aug 2023 17:38:54 +0800 Subject: [PATCH] 1 --- webapp/controller/MallController.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/controller/MallController.class.php b/webapp/controller/MallController.class.php index 0fde6f9c..e9347b69 100644 --- a/webapp/controller/MallController.class.php +++ b/webapp/controller/MallController.class.php @@ -165,6 +165,18 @@ class MallController extends BaseAuthedController { { $goodsUuid = getReqVal('goods_uuid', ''); $price = getReqVal('price', ''); + if (empty($price)) { + $this->_rspErr(1, 'price not found'); + return; + } + if ($price <= 0) { + $this->_rspErr(1, 'price must > 0'); + return; + } + if (!is_numeric($price)) { + $this->_rspErr(1, 'price must be number'); + return; + } $goodsDb = Mall::findByGoodsUuid($goodsUuid); if (!$goodsDb) { myself()->_rspErr(1, 'goods not found');