新武将:activityId参数

This commit is contained in:
luying
2022-08-03 15:12:30 +08:00
parent 3f06432b3f
commit 25c6785ac9
3 changed files with 3 additions and 3 deletions
@@ -127,7 +127,7 @@ export class GachaHandler {
} }
} }
} }
let userGacha = await UserGachaModel.findByRole(roleId, gachaId); let userGacha = await UserGachaModel.findByRole(roleId, gachaId, 0);
let { hope: userHope = []} = await refreshGacha(gameData.gacha.get(gachaId), userGacha); let { hope: userHope = []} = await refreshGacha(gameData.gacha.get(gachaId), userGacha);
for (let { id, hid } of hope) { for (let { id, hid } of hope) {
let curHope = userHope.find(cur => cur.id == id); let curHope = userHope.find(cur => cur.id == id);
@@ -24,7 +24,7 @@ import { refreshGacha } from './gachaService';
let createTime = await getRoleCreateTime(roleId); let createTime = await getRoleCreateTime(roleId);
let serverTime = await getServerCreateTime(serverId); let serverTime = await getServerCreateTime(serverId);
let playerData = new NewHeroGachaData(activityData, createTime, serverTime); let playerData = new NewHeroGachaData(activityData, createTime, serverTime);
let userGacha: UserGachaType = await UserGachaModel.findByRole(roleId, playerData.gachaId); let userGacha: UserGachaType = await UserGachaModel.findByRole(roleId, playerData.gachaId, activityId);
let dicGacha = gameData.gacha.get(playerData.gachaId); let dicGacha = gameData.gacha.get(playerData.gachaId);
userGacha = await refreshGacha(dicGacha, userGacha); userGacha = await refreshGacha(dicGacha, userGacha);
playerData.setPlayerRecords(userGacha, dicGacha); playerData.setPlayerRecords(userGacha, dicGacha);
+1 -1
View File
@@ -107,7 +107,7 @@ export default class UserGacha extends BaseModel {
return rec; return rec;
} }
public static async findByRole(roleId: string, gachaId: number, activityId: number = 0) { public static async findByRole(roleId: string, gachaId: number, activityId: number) {
const doc = new UserGachaModel(); const doc = new UserGachaModel();
const update = Object.assign(doc.toJSON(), { roleId, gachaId, activityId }); const update = Object.assign(doc.toJSON(), { roleId, gachaId, activityId });
delete update._id; delete update._id;