🐞 fix(guild): 修复军团退出重进数据重置问题

This commit is contained in:
dingchaolin
2023-02-27 20:31:12 +08:00
parent b75f21fcf3
commit 6f3859df16
4 changed files with 75 additions and 6 deletions

View File

@@ -8,13 +8,13 @@ import { gameData, getGoodById, getWishPoolReward } from '../../../pubUtils/data
import { addItems, checkGoods, checkHeroEquips, checkHeroes, getHonourObject, handleCost } from '../../../services/role/rewardService';
import { ITID, CONSUME_TYPE } from '../../../consts/constModules/itemConst';
import { GUILD_POINT_WAYS, GUILD_STRUCTURE, WISH_POOL_TYPE } from '../../../consts/constModules/guildConst';
import { getWishPool, getUserGuildWithRefActive, addActive } from '../../../services/guildService';
import { getWishPool, getUserGuildWithRefActive, addActive, canWishToday } from '../../../services/guildService';
import { findIndex, findWhere } from 'underscore';
import { RoleModel } from '../../../db/Role';
import { getRoleOnlineInfo } from '../../../services/redisService';
import { ARMY } from '../../../pubUtils/dicParam';
import { guildInter } from '../../../pubUtils/interface';
import { getSeconds, getZeroPoint, nowSeconds } from '../../../pubUtils/timeUtil';
import { getSeconds, getZeroPoint, nowSeconds, isToday } from '../../../pubUtils/timeUtil';
import { sendMessageToUserWithSuc } from '../../../services/pushService';
import { isGoodsHidden } from '../../../services/dataService';
export default function(app: Application) {
@@ -51,6 +51,11 @@ export class WishPoolHandler {
let userGuild = await getUserGuildWithRefActive(roleId);
if (!userGuild) return resResult(STATUS.WRONG_PARMS);
// 退出A军团 和 新入B军团 在同一天, 且在A军团已经许过愿那么此时不允许许愿
if (!await canWishToday(roleId)) {
return resResult(STATUS.HAS_REACH_WISH_COUNT_LIMIT);
}
const { guildCode: code, wishGoods, receivedWishPool } = userGuild;
let { lv } = await GuildModel.findGuild(code, serverId, 'lv');