挑战活动记录排行榜时,将对应的id存进去

This commit is contained in:
zhl 2021-05-18 12:03:40 +08:00
parent be0cb09b7b
commit c23efc4de6
2 changed files with 9 additions and 3 deletions

View File

@ -51,7 +51,7 @@ class ExamController extends BaseController {
let stat = new PuzzleStatusClass() let stat = new PuzzleStatusClass()
stat.timeLast = now stat.timeLast = now
history.members.set(accountid, stat) history.members.set(accountid, stat)
history.activityId = eid
history.expire = Date.now() + (record.qcount * record.timeone || 90) * 1000 history.expire = Date.now() + (record.qcount * record.timeone || 90) * 1000
history.type = 2 history.type = 2
history.total = record.qcount history.total = record.qcount
@ -126,7 +126,7 @@ class ExamController extends BaseController {
history.status = 9 history.status = 9
let rankObj = { let rankObj = {
shop: history.shop, shop: history.shop,
level: 'exam', level: history.activityId,
accountId: accountid, accountId: accountid,
score: statMap.score, score: statMap.score,
mode: 0, mode: 0,
@ -134,7 +134,7 @@ class ExamController extends BaseController {
} }
await history.save() await history.save()
await updateExamRank(rankObj) 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.rankList = rankList
rspData.userRank = userRank rspData.userRank = userRank
} }

View File

@ -89,6 +89,12 @@ export class PuzzleSessionClass extends BaseModule {
@prop() @prop()
public level: number public level: number
/**
* , id存入该字段
* @type {string}
*/
@prop()
public activityId: string
@prop() @prop()
public room: string public room: string