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),