This commit is contained in:
aozhiwei 2023-07-31 11:22:43 +08:00
parent 4a29b72e75
commit 24d154faff

View File

@ -40,17 +40,17 @@ class ShopService {
array_push($goodsList, $goodsDto); array_push($goodsList, $goodsDto);
switch ($goodsMeta['limit_type']) { switch ($goodsMeta['limit_type']) {
case mt\Item::DAILY_BUY_LIMIT: { case mt\Item::DAILY_BUY_LIMIT: {
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']); $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_day_buy_times'] : 0; $goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_day_buy_times'] : 0;
} }
break; break;
case mt\Item::WEEKLY_BUY_LIMIT: { case mt\Item::WEEKLY_BUY_LIMIT: {
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']); $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0; $goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0;
} }
break; break;
case mt\Item::TOTAL_BUY_LIMIT: { case mt\Item::TOTAL_BUY_LIMIT: {
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']); $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0; $goodsDto['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0;
} }
break; break;
@ -77,7 +77,7 @@ class ShopService {
if (!empty($goods['free_type'])) { if (!empty($goods['free_type'])) {
$count = self::getFreeBuyTimes($goodsMeta['free_type'], $count = self::getFreeBuyTimes($goodsMeta['free_type'],
$goodsMeta['id'], $goodsMeta['goods_id'],
$goodsMeta['goods_id']); $goodsMeta['goods_id']);
$goodsDto['free_num'] = $goodsDto['free_num'] - $count; $goodsDto['free_num'] = $goodsDto['free_num'] - $count;
} }