军团:修复捐献宝箱
This commit is contained in:
@@ -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 }, {});
|
||||
|
||||
Reference in New Issue
Block a user