diff --git a/src/api_s2c/event/huangqijiuguan/fun.ts b/src/api_s2c/event/huangqijiuguan/fun.ts index a83e5db..552729b 100644 --- a/src/api_s2c/event/huangqijiuguan/fun.ts +++ b/src/api_s2c/event/huangqijiuguan/fun.ts @@ -116,7 +116,6 @@ export default class HQJGFun { todaydps: {}, recdpstask: [] }, - lasttime: 0 } } @@ -209,15 +208,11 @@ export default class HQJGFun { /** 设置我的数据 */ static async setMyData(uid: string, hdid: number, update: { [k in keyof Partial]: PlayerData[k] }) { - if (!update.lasttime) { - update.lasttime = G.time; - } - let res = await G.mongodb.cEvent(this.dataType(hdid)).updateOne( { uid: uid, type: this.dataType(hdid) }, { $set: update } ); - if (res.upsertedCount <= 0) { + if (res.modifiedCount <= 0) { await G.mongodb.cEvent(this.dataType(hdid)).updateOne( { uid: uid, type: this.dataType(hdid) }, { $set: Object.assign(this.defaultData, update) } );