排行榜:修复数据错误

This commit is contained in:
luying
2021-09-10 17:39:22 +08:00
parent faf4d25f60
commit cec130b7c4
3 changed files with 29 additions and 13 deletions
+15 -2
View File
@@ -177,14 +177,27 @@ export class GuildRankParam {
@prop({ required: true })
guildCe: number;
constructor(guild: GuildUpdateParam) {
constructor(guild: GuildUpdateParam, fromDb: boolean) {
this.icon = guild.icon;
this.name = guild.name;
this.lv = guild.lv;
let leader = <RoleType>guild.leader;
let _leader = new GuildLeader(leader);
this.leader = _leader;
this.guildCe = guild.guildCe;
console.log('*****', guild.isReducedCe, guild.guildCe, reduceCe(guild.guildCe))
if(guild.isReducedCe) {
this.guildCe = guild.guildCe;
} else {
this.guildCe = reduceCe(guild.guildCe);
}
if(fromDb && !(<GuildUpdateParam>guild).isReducedCe) {
this.guildCe = reduceCe(guild.guildCe);
} else {
this.guildCe = guild.guildCe;
}
this.memberCnt = guild.memberCnt;
}
}