排行榜:排行榜首通榜

This commit is contained in:
luying
2021-12-23 21:11:51 +08:00
parent 6c8be4e240
commit e61a034848
3 changed files with 9 additions and 9 deletions

View File

@@ -39,10 +39,13 @@ export default class HangUpRecord extends BaseModel {
received: boolean; // 是否已经领取true-领取false-未领取
public static async initRecord(roleId: string, roleName: string, lean = true) {
console.log('****** initRecord before')
const curTime = new Date();
const recDoc = new HangUpRecordModel();
const update = Object.assign(recDoc.toJSON(), {roleId, roleName, startTime: curTime, startLv: dicParam.TOWER_HANG_UP.TOWER_HANG_UP_ENABLE_LV + 1});
const rec: HangUpRecordType = await HangUpRecordModel.findOneAndUpdate({roleId, startLv: dicParam.TOWER_HANG_UP.TOWER_HANG_UP_ENABLE_LV + 1}, update, {upsert: true, new: true}).lean(lean);
const rec: HangUpRecordType = await HangUpRecordModel.findOneAndUpdate({roleId, startLv: dicParam.TOWER_HANG_UP.TOWER_HANG_UP_ENABLE_LV + 1}, { $setOnInsert: update }, {upsert: true, new: true}).lean(lean);
console.log('****** initRecord after')
return rec;
}