diff --git a/shared/db/HangUpRecord.ts b/shared/db/HangUpRecord.ts index 2e2cf8900..f168c2f98 100644 --- a/shared/db/HangUpRecord.ts +++ b/shared/db/HangUpRecord.ts @@ -11,7 +11,7 @@ class Goods { /** * 挂机记录表 */ -@index({ roleId: 1, endLv: 1 }) +@index({ roleId: 1, startLv: 1 }) export default class HangUpRecord extends BaseModel { @prop({ required: true }) diff --git a/shared/db/Hero.ts b/shared/db/Hero.ts index 3f3b78d64..066f182b4 100644 --- a/shared/db/Hero.ts +++ b/shared/db/Hero.ts @@ -14,6 +14,8 @@ export default class Hero extends BaseModel { roleId: string; // 角色 id @prop({ required: true }) roleName: string; // 角色名称 + @prop({ required: true }) + serverId: number; // 区服 id @prop({ required: true }) hid: number; // 武将 id diff --git a/shared/db/Role.ts b/shared/db/Role.ts index 19b2205cd..d7551e0c9 100644 --- a/shared/db/Role.ts +++ b/shared/db/Role.ts @@ -16,6 +16,7 @@ class TopHero { * 角色字段接口 */ @index({ roleId: 1 }) +@index({ serverId: 1, roleId: 1}) @index({ towerLv: -1, towerUpTime: 1 }) // @index({ userInfo.uid: 1, serverId: 1 }) export default class Role extends BaseModel {