From 4e205b47bb6b31c293489a8c1ed171eb897ddc61 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 8 Nov 2022 16:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E5=9B=A2=E8=B4=AD):=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=90=AF=E5=8A=A8=E6=97=B6=E6=9C=AA=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E5=A4=A7=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/timeTaskService.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/game-server/app/services/timeTaskService.ts b/game-server/app/services/timeTaskService.ts index a55c2502a..2be218067 100644 --- a/game-server/app/services/timeTaskService.ts +++ b/game-server/app/services/timeTaskService.ts @@ -816,9 +816,16 @@ async function initGroupShopSchedule() { let initSumJobs = []; export async function initSumSchedule() { - + let servers = await ServerlistModel.findByEnv(pinus.app.get('env')); + let groupIds: number[] = []; + for(let { id } of servers) { + let groups = await ActivityGroupModel.findByServerId(id); + for(let { groupId } of groups) { + groupIds.push(groupId); + } + } - let activities = await ActivityModel.findActivityByType(ACTIVITY_TYPE.GROUP_SHOP); + let activities = await ActivityModel.findOpenActivityByType(groupIds, ACTIVITY_TYPE.GROUP_SHOP); let scheduleMap = new Map(); // 时间 => data for(let activity of activities) { let timers = await getGroupShopTimers(activity);