🐞 fix(guild): 修改军团周奖励发放拦截条件

This commit is contained in:
dingchaolin
2023-03-03 17:53:20 +08:00
parent 968bfc56dc
commit 8b3bbaf90d

View File

@@ -1,7 +1,7 @@
import { UserGuildModel, UserGuildType } from '../db/UserGuild';
import { getArmyTrainJuDian, getGuildTrainGkInfo, getTrainBaseByLv } from '../pubUtils/data';
import { nowSeconds, getZeroPoint, isToday, getSeconds } from '../pubUtils/timeUtil';
import { GUILD_STRUCTURE, PUSH_ROUTE } from '../consts';
import { GUILD_STRUCTURE, PUSH_ROUTE, SHOP_REFRESH_TYPE } from '../consts';
import { GuildTrainType, GuildTrainModel, TrainInstance } from '../db/GuildTrain';
import { GuildModel, GuildType } from '../db/Guild';
import { findWhere } from 'underscore';
@@ -170,9 +170,8 @@ export async function resetTrain(code: string, serverId: number) {
//结算未领取的宝箱奖励发送到邮件中
userGuildList.forEach(async function ({roleId, trainRewards, createdAt}) {
if (isToday(getSeconds(createdAt))) {
// 此处发放的奖励是昨天该军团的奖励
// 今天加入军团的玩家,不发放
if (getZeroPoint(SHOP_REFRESH_TYPE.WEEKLY) < getSeconds(createdAt)) {
// 此处发放的奖励是上周该军团的奖励; 如果本周一5AM之后不发放
return;
}
let goods: { id: number, count: number }[] = [];