🐞 fix(guild): 修改军团试炼奖励多发放问题
This commit is contained in:
@@ -17,6 +17,7 @@ import { sendMailByContent } from './mailService';
|
|||||||
import { MAIL_TYPE } from '../consts';
|
import { MAIL_TYPE } from '../consts';
|
||||||
import { getGuildChannelSid } from './chatChannelService';
|
import { getGuildChannelSid } from './chatChannelService';
|
||||||
import { sendMessageToGuildWithSuc } from './pushService';
|
import { sendMessageToGuildWithSuc } from './pushService';
|
||||||
|
import { gameData } from '../pubUtils/data';
|
||||||
/**
|
/**
|
||||||
* 获得userGuild,并检查,是否需要每日重置购买挑战次数和今日挑战次数,已经检查是否需要每周重置练兵场
|
* 获得userGuild,并检查,是否需要每日重置购买挑战次数和今日挑战次数,已经检查是否需要每周重置练兵场
|
||||||
* @param roleId
|
* @param roleId
|
||||||
@@ -185,6 +186,8 @@ export async function resetTrain(code: string, serverId: number) {
|
|||||||
if (!!res.err)
|
if (!!res.err)
|
||||||
return;
|
return;
|
||||||
let { structure, trainId, resetTrainTimeDaily } = await GuildModel.findGuild(code, serverId, 'structure trainId resetTrainTimeDaily');
|
let { structure, trainId, resetTrainTimeDaily } = await GuildModel.findGuild(code, serverId, 'structure trainId resetTrainTimeDaily');
|
||||||
|
// 上周试炼到的trainId
|
||||||
|
const currentTrainId = trainId;
|
||||||
// if(trainId && shouldRefresh(resetTrainTimeDaily, new Date())) {
|
// if(trainId && shouldRefresh(resetTrainTimeDaily, new Date())) {
|
||||||
// let { trainInstances } = getArmyTrainJuDian(trainId);
|
// let { trainInstances } = getArmyTrainJuDian(trainId);
|
||||||
// // 初始化
|
// // 初始化
|
||||||
@@ -210,6 +213,7 @@ export async function resetTrain(code: string, serverId: number) {
|
|||||||
const userGuildList = await UserGuildModel.getListByGuild(code, 'trainRewards roleId createdAt', {});
|
const userGuildList = await UserGuildModel.getListByGuild(code, 'trainRewards roleId createdAt', {});
|
||||||
const guildTrains = await GuildTrainModel.getGuildTrainBoxs(code);
|
const guildTrains = await GuildTrainModel.getGuildTrainBoxs(code);
|
||||||
|
|
||||||
|
const minTrainIdOfCurrentLv = gameData.firstGuildTrainIdOfLv.get(lv);
|
||||||
//结算未领取的宝箱奖励发送到邮件中
|
//结算未领取的宝箱奖励发送到邮件中
|
||||||
userGuildList.forEach(async function ({roleId, trainRewards, createdAt}) {
|
userGuildList.forEach(async function ({roleId, trainRewards, createdAt}) {
|
||||||
if (getZeroPoint(SHOP_REFRESH_TYPE.WEEKLY) < getSeconds(createdAt)) {
|
if (getZeroPoint(SHOP_REFRESH_TYPE.WEEKLY) < getSeconds(createdAt)) {
|
||||||
@@ -227,7 +231,7 @@ export async function resetTrain(code: string, serverId: number) {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let trainId = 1; trainId < guild.trainId; trainId++) {
|
for (let trainId = minTrainIdOfCurrentLv; trainId < currentTrainId; trainId++) {
|
||||||
let { jinjieReward } = getArmyTrainJuDian(trainId);
|
let { jinjieReward } = getArmyTrainJuDian(trainId);
|
||||||
if (trainRewards.indexOf(trainId) === -1) {
|
if (trainRewards.indexOf(trainId) === -1) {
|
||||||
goods.push(...jinjieReward);
|
goods.push(...jinjieReward);
|
||||||
|
|||||||
Reference in New Issue
Block a user