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