diff --git a/game-server/app/services/warRewardService.ts b/game-server/app/services/warRewardService.ts index 890da7311..d55ac6acc 100644 --- a/game-server/app/services/warRewardService.ts +++ b/game-server/app/services/warRewardService.ts @@ -19,7 +19,7 @@ export class WarReward { private condition: Map; private warInfo: any; private isSuccess: boolean; - private rewards: Array<{type: number, gid: number, count: number, times: number}>; + private rewards: Array<{type: number, id: number, count: number, times: number}>; private fixReward: string; private conditionReward: string; private randomReward: string; @@ -106,8 +106,8 @@ export class WarReward { let reward = decodeStr('randomReward', randomReward); for(let obj of reward) { - let { gid, frequency } = obj; - let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, gid); + let { id, frequency } = obj; + let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, id); let { getNum = 0, allNum = 0, getSum = 0, allSum = 0 } = dropHistory; for(let i = 0; i < num; i ++) { let flag = false; // 是否可以获得 @@ -126,7 +126,7 @@ export class WarReward { this.rewards.push({type: BATTLE_REWARD_TYPE.RANDOM_REWARD, times: i +1, ...obj}); } } - await BattleDropModel.updateByGid(this.roleId, this.battleId, gid, { + await BattleDropModel.updateByGid(this.roleId, this.battleId, id, { getNum, allNum, getSum, allSum }); } @@ -179,7 +179,7 @@ export class WarReward { const blueprtList = getBluePrtByQuality(id); const gid = getRandomByLen(blueprtList); - return {gid, count:1} + return {id: gid, count:1} } else { return null }