🐞 fix(gvg): 军团替换团长之后相关信息更新

This commit is contained in:
luying
2023-02-08 10:47:41 +08:00
parent 0b877150ea
commit 542845af09
4 changed files with 12 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
// 和gvg组建期相关的方法
import { GUILD_AUTH, GVG_APPLY_TYPE, GVG_PERIOD, GVG_SERVER_TYPE, LEAGUE_AUTH, LEAGUE_MANAGE_TYPE, PUSH_ROUTE, STATUS } from "../../consts";
import { GUILD_AUTH, GVG_APPLY_TYPE, GVG_PERIOD, GVG_SERVER_TYPE, LEAGUE_AUTH, LEAGUE_MANAGE_TYPE, PUSH_ROUTE, REDIS_KEY, STATUS } from "../../consts";
import { GuildModel, GuildType } from "../../db/Guild";
import { GVGLeagueModel, GVGLeagueType, GVGLeagueUpdate } from "../../db/GVGLeague";
import { GVGLeagueApplyModel, GVGLeagueApplyType } from "../../db/GVGLeagueApply";
@@ -8,10 +8,12 @@ import { GVGLeaguePrepareModel, GVGLeaguePrepareType } from "../../db/GVGLeagueP
import { RoleType } from "../../db/Role";
import { UserGuildModel } from "../../db/UserGuild";
import { LeagueGuildInfo, LeagueListInfo } from "../../domain/gvgField/returnData";
import { LeagueLeader } from "../../domain/rank";
import { GVG } from "../../pubUtils/dicParam";
import { getZeroPointD } from "../../pubUtils/timeUtil";
import { resResult } from "../../pubUtils/util";
import { sendMessageToUserWithSuc } from "../pushService";
import { updateUserInfo } from "../redisService";
import { guildJoinLeagueRecord } from "./gvgRecService";
import { calLeagueCe, getCurPeriod, getGVGConfig, getGVGPeriodData, getGVGServerType } from "./gvgService";
@@ -227,4 +229,5 @@ export async function guildDismissToLeague(guild: GuildType) {
export async function guildAbdicateToLeague(guild: GuildType, fromRoleId: string, toRole: RoleType) {
if(!guild.leagueCode) return;
await GVGLeagueModel.abdicateGuild(guild.leagueCode, fromRoleId, toRole.roleId, toRole._id);
await updateUserInfo(REDIS_KEY.LEAGUE_INFO, guild.leagueCode, [{ field: 'leader', value: new LeagueLeader(toRole) }]);
}