This commit is contained in:
aozhiwei 2023-07-31 11:41:44 +08:00
parent bfc870c3ba
commit b31eccf460

View File

@ -310,7 +310,7 @@ class ShopController extends BaseAuthedController {
public function boxPreview() public function boxPreview()
{ {
$goodsId = $goods['goods_id']; $goodsId = getReqVal('goods_id', '');
$goodsMeta = mt\ShopGoods::get($goodsId); $goodsMeta = mt\ShopGoods::get($goodsId);
if (!$goodsMeta) { if (!$goodsMeta) {
@ -339,14 +339,13 @@ class ShopController extends BaseAuthedController {
} }
} }
if (!empty($goods['free_type'])) { $freeNum = 0;
$count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']); if (!empty($goodsMeta['free_type'])) {
$goods['free_num'] = $goods['free_num'] - $count; //$count = $this->countFreeBuyTimes($goods['free_type'], $goods['id'], $goods['goods_id']);
//$goodsMe['free_num'] = $goods['free_num'] - $count;
} else { } else {
$goods['free_num'] = 0; //$goods['free_num'] = 0;
} }
$freeNum = $goods['free_num'];
$this->_rspData( $this->_rspData(
array( array(
'items' => array_keys($record), 'items' => array_keys($record),