Merge branch 'star' of git.kingsome.cn:server/game2006api into star

This commit is contained in:
hujiabin 2023-07-06 21:42:55 +08:00
commit 585b2e5e2c

View File

@ -153,7 +153,7 @@ 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;
error_log('free_num:' . $goods['free_num']);
// error_log('free_num:' . $goods['free_num']);
}
$address = $this->_getAddress();
@ -424,7 +424,7 @@ class ShopController extends BaseAuthedController
$max_count = count($arrCosts);
$cost = $count < $max_count ? $arrCosts[$count] : -1;
error_log('getDailySelectionList address: ' . $address . ' idx:' . $selection['idx'] . ' refresh_info:' . "{$count}/{$max_count}" . ' cost:' . $cost);
// error_log('getDailySelectionList address: ' . $address . ' idx:' . $selection['idx'] . ' refresh_info:' . "{$count}/{$max_count}" . ' cost:' . $cost);
$this->_rspData(
array(
@ -593,6 +593,9 @@ class ShopController extends BaseAuthedController
);
break;
case ShopController::TOKEN_TYPE_DIAMOND:
if ($isFreeBuy) {
$need_price = 0;
}
$costItems = $this->makeCostItems($costItemId, $goods_num * $need_price);
$lackItem = null;
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
@ -608,6 +611,9 @@ class ShopController extends BaseAuthedController
$awardService = new services\AwardService();
$awardService->addItem($row['goods_id'], $goods_num);
ShopBuyRecord::add($id, $goods_num);
if ($isFreeBuy) {
$this->addFreeBuyRecord($row);
}
$this->_decItems($costItems);
$goodsDto = array(
'goods_id' => $id,
@ -786,6 +792,7 @@ class ShopController extends BaseAuthedController
'idx' => $idx,
'grid' => $grid,
'count' => $count,
'award' => $awardService->toDto(),
)
);
}