diff --git a/game-server/app/services/guildService.ts b/game-server/app/services/guildService.ts index 3fc969751..3634a7397 100644 --- a/game-server/app/services/guildService.ts +++ b/game-server/app/services/guildService.ts @@ -223,11 +223,14 @@ export async function refreshUserGuild(userGuild: UserGuildType, roleId: string) const now = new Date(); let isRefDaily = shouldRefresh(refTimeDaily, now); + console.log('####### isRefDaily', isRefDaily, refTimeDaily, now) if (isRefDaily) { - await sendUnreceivedWishPool(wishGoods, roleId); - await sendUnreceivedActiveBox(roleId, userGuild.guildCode, refTimeDaily, receivedActive); - await sendUnreceivedDonateBox(roleId, userGuild.guildCode, refTimeDaily, receiveBoxs); - await sendUnreceivedBossWar(roleId, refTimeDaily); + if(refTimeDaily) { + await sendUnreceivedWishPool(wishGoods, roleId); + await sendUnreceivedActiveBox(roleId, userGuild.guildCode, refTimeDaily, receivedActive); + await sendUnreceivedDonateBox(roleId, userGuild.guildCode, refTimeDaily, receiveBoxs); + await sendUnreceivedBossWar(roleId, refTimeDaily); + } receivedActive = []; refTimeDaily = now; activeDaily = 0; activeRecord = []; wishGoods = []; receivedWishPool = [], receiveBoxs = []; let wishDntCnt = 0, donateCnt = 0; userGuild = await UserGuildModel.updateInfo(roleId, { receivedActive, refTimeDaily, activeDaily, activeRecord, wishGoods, receiveBoxs, wishDntCnt, donateCnt, receivedWishPool }, {});