diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index c0514169..5f5e7666 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -1375,7 +1375,13 @@ class ShopController extends BaseAuthedController } } - $free_num = $goods['free_num'] - $this->countFreeBuyTimes($address, $id, $goods_id); + if (!empty($goods['free_type'])) { + $count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']); + $goods['free_num'] = $goods['free_num'] - $count; + error_log('free_num:' . $goods['free_num']); + } + + $free_num = $goods['free_num']; $pending = $this->checkPendingBuyGoodsNormal($address, $goods_id, $shop_id, $id); error_log("getChestItems start " . json_encode( array(