From b4c0dc7da748a9b67c5b731b56110dae34987c28 Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Tue, 17 Nov 2020 20:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/HangUpRecord.ts | 2 +- shared/db/Hero.ts | 2 ++ shared/db/Role.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) 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 {