From b31eccf4609e1c5ee54f26e4e7dbcf45b3259952 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Jul 2023 11:41:44 +0800 Subject: [PATCH] 1 --- webapp/controller/ShopController.class.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 19932e6c..2448910e 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -310,7 +310,7 @@ class ShopController extends BaseAuthedController { public function boxPreview() { - $goodsId = $goods['goods_id']; + $goodsId = getReqVal('goods_id', ''); $goodsMeta = mt\ShopGoods::get($goodsId); if (!$goodsMeta) { @@ -339,14 +339,13 @@ class ShopController extends BaseAuthedController { } } - if (!empty($goods['free_type'])) { - $count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']); - $goods['free_num'] = $goods['free_num'] - $count; + $freeNum = 0; + if (!empty($goodsMeta['free_type'])) { + //$count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']); + //$goodsMe['free_num'] = $goods['free_num'] - $count; } else { - $goods['free_num'] = 0; + //$goods['free_num'] = 0; } - - $freeNum = $goods['free_num']; $this->_rspData( array( 'items' => array_keys($record),