feat(巅峰演武): 详细信息&战报添加区服名

This commit is contained in:
luying
2022-11-08 15:38:28 +08:00
parent 2eb2bc7573
commit fb17ed3c6a
4 changed files with 29 additions and 8 deletions
+8 -3
View File
@@ -57,6 +57,8 @@ export class HeroesRecord {
}
export class PvpRecordPlayerInfo {
@prop({ required: true })
serverId: number; // 区服id
@prop({ required: true })
roleId: string; // 角色 id
@prop({ required: true })
@@ -92,9 +94,10 @@ export class PvpRecordPlayerInfo {
this.isSuccess = isSuccess;
this.score = score;
this.heroes = heroes;
this.serverId = role.serverId;
}
setByHistoryOpp(oppRole: PvpHistoryOppType, oppHeroRecords: HeroesRecord[], isSuccess: boolean, score: number) {
setByHistoryOpp(oppRole: PvpHistoryOppType, oppHeroRecords: HeroesRecord[], isSuccess: boolean, score: number, serverId: number) {
this.roleId = robotIdComBack(oppRole.oppRoleId);
this.roleName = oppRole.roleName;
this.lv = oppRole.pLv;
@@ -106,6 +109,7 @@ export class PvpRecordPlayerInfo {
this.heroes = oppHeroRecords;
this.isSuccess = isSuccess;
this.score = score;
this.serverId = serverId;
}
}
@@ -140,7 +144,7 @@ export default class PvpRecord extends BaseModel {
public static async getRecByRoleId( roleId: string, limit = 15, lean = true) {
await this.delPvpRecords();
const result: PvpRecord[] = await PvpRecordModel.find({ $or:[{roleId1: roleId}, {roleId2: roleId}] }).limit(limit).sort({createTime: -1}).lean(lean);
const result: PvpRecord[] = await PvpRecordModel.find({ $or:[{roleId1: roleId}, {roleId2: roleId}] }).select('-_id -__v -createdAt -updatedAt').limit(limit).sort({createTime: -1}).lean(lean);
return result;
}
@@ -153,4 +157,5 @@ export default class PvpRecord extends BaseModel {
export const PvpRecordModel = getModelForClass(PvpRecord);
export interface PvpRecordType extends Pick<DocumentType<PvpRecord>, keyof PvpRecord> { };
export interface PvpRecordType extends Pick<DocumentType<PvpRecord>, keyof PvpRecord> { };
export type PvpRecordParam = Partial<PvpRecordType>;
+6
View File
@@ -92,6 +92,8 @@ export class PlayerDetail {
roleId: string;
roleName: string;
lv: number;
serverName: string;
title?: number = 1;
ipLocation: string = '';
head?: number = EXTERIOR.EXTERIOR_FACE;
@@ -135,6 +137,10 @@ export class PlayerDetail {
this.ipLocation = role.fixedIpLocation||role.ipLocation||'未知';
}
setServerName(serverName: string) {
this.serverName = serverName;
}
setCe(ce: number) {
this.defCe = ce;
}