军团:许愿池捐赠者没有扣除道具
This commit is contained in:
@@ -5,7 +5,7 @@ import { WishPoolReportModel } from '../../../db/WishPoolReport';
|
||||
import { resResult, genCode } from '../../../pubUtils/util';
|
||||
import { ITEM_CHANGE_REASON, PUSH_ROUTE, STATUS } from '../../../consts';
|
||||
import { getArmyWishPoolBaseByLv, getGoodById, getWishPoolReward } from '../../../pubUtils/data';
|
||||
import { addItems, checkGoods, checkHeroEquips, checkHeroes, getHonourObject } from '../../../services/role/rewardService';
|
||||
import { addItems, checkGoods, checkHeroEquips, checkHeroes, getHonourObject, handleCost } from '../../../services/role/rewardService';
|
||||
import { ITID, CONSUME_TYPE } from '../../../consts/constModules/itemConst';
|
||||
import { GUILD_STRUCTURE } from '../../../consts/constModules/guildConst';
|
||||
import { refreshUserGuild, getWishPool, getUserGuildWithRefActive } from '../../../services/guildService';
|
||||
@@ -120,6 +120,9 @@ export class WishPoolHandler {
|
||||
let dicWishReward = getWishPoolReward(wishGood.goodId);
|
||||
if(!dicWishReward) return resResult(STATUS.DIC_DATA_NOT_FOUND);
|
||||
|
||||
let costResult = await handleCost(dntRoleId, sid, [{ id: wishGood.goodId, count: 1 }], ITEM_CHANGE_REASON.WISH_POOL_DONATE);
|
||||
if(!costResult) return resResult(STATUS.GUILD_DONATE_CAN_NOT_SEND);
|
||||
|
||||
let { wishDntCnt } = await UserGuildModel.donateGoods(dntRoleId, 1, 'wishDntCnt');
|
||||
let { wishGoods: resWishGoods } = await UserGuildModel.donateUpdate(wishRoleId, dntRoleName, id, 'wishGoods');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user