🐞 fix(稷下学宫): 修改商店购买价格
This commit is contained in:
@@ -674,20 +674,20 @@ export class RougeHandler {
|
||||
if (!shop || shop.optionStatus != ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE) return resResult(STATUS.SHOP_NO_BUY);
|
||||
|
||||
let dbRecord = await RougelikeRecordModel.findByGameCode(gameCode);
|
||||
if (!dbRecord || (dbRecord.coin || 0) < shop.price) return resResult(STATUS.COIN_NOT_ENOUGH);
|
||||
if (!dbRecord || (dbRecord.coin || 0) < shop.discountPrice) return resResult(STATUS.COIN_NOT_ENOUGH);
|
||||
|
||||
|
||||
shop.optionStatus = ROUGE_LIKE_CHOOSE_REWARD.CHOOSE;
|
||||
|
||||
await RougelikeRecordDetailModel.updateShopByCode(gameCode, detailCode, optionIndex, shop.optionStatus);
|
||||
await RougelikeRecordModel.updateByGameCode(gameCode, { $set: { coin: (dbRecord.coin || 0) - shop.price } });
|
||||
await RougelikeRecordModel.updateByGameCode(gameCode, { $set: { coin: (dbRecord.coin || 0) - shop.discountPrice } });
|
||||
|
||||
let handleAddFun = new HandleAddCard(session, gameCode, dbDetail);
|
||||
handleAddFun.pushCard(shop.rewardId, shop.rewardType);
|
||||
let result = await handleAddFun.save();
|
||||
result = await handleAddFun.getHolyEffect();
|
||||
|
||||
return resResult(STATUS.SUCCESS, { curShop: shop, ...result, redCoin: -shop.price });
|
||||
return resResult(STATUS.SUCCESS, { curShop: shop, ...result, redCoin: -shop.discountPrice });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user