排行榜:排行榜首通榜
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user