From 036abb80b4dec1af47d3c1ec3b7351ede39ea6bf Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Fri, 12 Jan 2024 02:29:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=BB=84=E8=8A=AA=E9=85=92=E9=A6=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/huangqijiuguan/fun.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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) } );