From b8fff7cc839b34b2bd1b43c00ce91b61d5dc338a Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 3 Dec 2021 20:35:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E6=8A=BD=E5=8D=A1=E8=A6=86=E7=9B=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/activity/handler/gachaHandler.ts | 7 ++++--- shared/db/UserGacha.ts | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/game-server/app/servers/activity/handler/gachaHandler.ts b/game-server/app/servers/activity/handler/gachaHandler.ts index 04510db53..61b8c3e4e 100644 --- a/game-server/app/servers/activity/handler/gachaHandler.ts +++ b/game-server/app/servers/activity/handler/gachaHandler.ts @@ -403,15 +403,16 @@ export class GachaHandler { const gachaId = GACHA_ID.NORMAL; let userGacha = await UserGachaModel.findByRole(roleId, GACHA_ID.NORMAL); - let { guideResultList, candidates = [] } = userGacha; + let { guideResultList, candidates = [], guideCount } = userGacha; let index = candidates.findIndex(cur => cur.id == id); if(index == -1) { candidates.push({ - id, list: guideResultList + id, guideCount, list: guideResultList }); - } else { + } else { candidates[index].list = guideResultList; + candidates[index].guideCount = guideCount; } userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { candidates }) diff --git a/shared/db/UserGacha.ts b/shared/db/UserGacha.ts index 79eaf4573..536349365 100644 --- a/shared/db/UserGacha.ts +++ b/shared/db/UserGacha.ts @@ -50,6 +50,8 @@ class SimpleResult { class Candidate { @prop({ required: true }) id: number; // 列表id + @prop({ required: true }) + guideCount: number; // 引导次数 @prop({ required: true, type: SimpleResult, _id: false }) list: SimpleResult[]; // 是否得到 }