From c23efc4de634680742b269ba49830deab8ac504e Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 18 May 2021 12:03:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=91=E6=88=98=E6=B4=BB=E5=8A=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=8E=92=E8=A1=8C=E6=A6=9C=E6=97=B6,=E5=B0=86?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84id=E5=AD=98=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/exam.controller.ts | 6 +++--- src/models/match/PuzzleSession.ts | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api/controllers/exam.controller.ts b/src/api/controllers/exam.controller.ts index 5d865ae..e77d560 100644 --- a/src/api/controllers/exam.controller.ts +++ b/src/api/controllers/exam.controller.ts @@ -51,7 +51,7 @@ class ExamController extends BaseController { let stat = new PuzzleStatusClass() stat.timeLast = now history.members.set(accountid, stat) - + history.activityId = eid history.expire = Date.now() + (record.qcount * record.timeone || 90) * 1000 history.type = 2 history.total = record.qcount @@ -126,7 +126,7 @@ class ExamController extends BaseController { history.status = 9 let rankObj = { shop: history.shop, - level: 'exam', + level: history.activityId, accountId: accountid, score: statMap.score, mode: 0, @@ -134,7 +134,7 @@ class ExamController extends BaseController { } await history.save() await updateExamRank(rankObj) - let {rankList, userRank } = await getRank({shop: history.shop, level: 'exam', accountId: accountid, mode: 0, skip: 0, limit: 20}) + let {rankList, userRank } = await getRank({shop: history.shop, level: history.activityId, accountId: accountid, mode: 0, skip: 0, limit: 20}) rspData.rankList = rankList rspData.userRank = userRank } diff --git a/src/models/match/PuzzleSession.ts b/src/models/match/PuzzleSession.ts index a68069a..70606cd 100644 --- a/src/models/match/PuzzleSession.ts +++ b/src/models/match/PuzzleSession.ts @@ -89,6 +89,12 @@ export class PuzzleSessionClass extends BaseModule { @prop() public level: number + /** + * 活动或者挑战, 可将相关的id存入该字段 + * @type {string} + */ + @prop() + public activityId: string @prop() public room: string