From 184bdd304e0e4d3dd857b8101f4d6c0ef2ad12ba Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Fri, 12 Jan 2024 23:32:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=8F=90=E4=BA=A4=EF=BC=8C?= =?UTF-8?q?=E5=85=91=E6=8D=A2=E6=8E=89=E8=90=BD=E4=BF=AE=E6=94=B9=E7=A4=BC?= =?UTF-8?q?=E5=8C=85=E5=86=85=E5=AE=B9=EF=BC=8C=20=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E6=96=B0=E5=B9=B4=E5=A4=B4=E5=83=8F=E6=A1=86=E5=88=B7=E6=88=90?= =?UTF-8?q?=E6=B0=B8=E4=B9=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240112.ts | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/fix_patch/patch_20240112.ts diff --git a/src/fix_patch/patch_20240112.ts b/src/fix_patch/patch_20240112.ts new file mode 100644 index 0000000..2a03906 --- /dev/null +++ b/src/fix_patch/patch_20240112.ts @@ -0,0 +1,48 @@ +import { patchFun, patchInit } from "../patch"; + +class Path { + + async huodong2(a: any) { + const hdids = [2002,2003] + const hdinfos = await G.mongodb.find('hdinfo', { hdid: { $in: hdids } }) + for (let i = 0; i < hdinfos.length; i++) { + let hdinfo = hdinfos[i] + hdinfo.data.gift = {} + + await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data.figt": {}} }); + console.log(hdinfo.hdid,"finish") + } + + return "sucess!!!" + } + + async headFrame(a: any) { + const users = await G.mongodb.find('user', {"headFrames.25": {"$exists": 1}}) + for (let i = 0; i < users.length; i++) { + let user = users[i] + user.headFrames["25"] = -1 + await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} }); + console.log(user.uid, user.headFrames) + } + + return "sucess!!!" + } + + + async run() { + await this.huodong2(1); + await this.headFrame(1); + } +} + +async function main() { + await patchInit() + let patch = new Path(); + await patch.run(); + console.log("逻辑执行完成,等待退出"); + setTimeout(function () { + console.log('结束程序'); + process.exit(); + }, 3000); +} +main();