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);