diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 18e9191..70399d0 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -296,6 +296,10 @@ class ShopController{ $id = $_REQUEST['id']; $type = $_REQUEST['type']; $num = $_REQUEST['num']; + if ($num < 0) { + phpcommon\sendError(ERR_USER_BASE + 2,'没有这个商品'); + return; + } $user_db = $this->readShopDB($account_id); $redis_goods = $this->getGoodsDiscount($id, $type, $user_db); $shop_conf = metatable\getShopById($type);