镇念塔:系统参数表
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { HANG_UP_CONSTS } from './../consts';
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import * as dicParam from '../pubUtils/dicParam';
|
||||
|
||||
class Goods {
|
||||
@prop({ required: true })
|
||||
@@ -41,8 +42,8 @@ export default class HangUpRecord extends BaseModel {
|
||||
public static async initRecord(roleId: string, roleName: string, lean = true) {
|
||||
const curTime = new Date();
|
||||
const recDoc = new HangUpRecordModel();
|
||||
const update = Object.assign(recDoc.toJSON(), {roleId, roleName, startTime: curTime, startLv: HANG_UP_CONSTS.ENABLE_LV});
|
||||
const rec: HangUpRecordType = await HangUpRecordModel.findOneAndUpdate({roleId, startLv: HANG_UP_CONSTS.ENABLE_LV}, update, {upsert: true, new: true}).lean(lean);
|
||||
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);
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user