From 2d62a387b6460e46de2cb0f7934e09027b5b86ae Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Sat, 6 Jan 2024 17:30:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=85=BB=E6=88=90=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E7=A4=BC=E5=8C=85=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yangchengmubiao/ApiOpen.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts index 89f91a9..611e38e 100644 --- a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts +++ b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts @@ -2,6 +2,8 @@ import { ApiCall } from "tsrpc"; import { HuoDongFun } from "../../../public/huodongfun"; import { ReqOpen, ResOpen } from "../../../shared/protocols/event/yangchengmubiao/PtlOpen"; import { YangChengMuBiaofun } from "./fun"; +import { PayFun } from "../../../public/pay"; +import { payLog } from "../../../shared/protocols/pay/PtlGetList"; export default async function (call: ApiCall) { let _hdinfo = await HuoDongFun.getHdidInfo(call, call.req.hdid) @@ -9,6 +11,23 @@ export default async function (call: ApiCall) { // 无此活动 return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 }) } + + let delPay: { payId: string, val: payLog[] }[] = []; + let payIds = _hdinfo.data.gift.map(v => v.payId); + let payLogs = await PayFun.getPayLogs(call.uid, payIds); + + for (let payid in payLogs) { + if (payLogs[payid].length > 0) { + if (payIds[payIds].slice(-1)[0].time < _hdinfo.stime) { + delPay.push({ payId: payid, val: [] }); + } + } + } + + if (delPay.length > 0) { + await PayFun.delPayLog(call.uid, ...delPay); + } + let _mydata = await YangChengMuBiaofun.getMyData(call, call.req.hdid) let changedata = { mydata: _mydata, hdinfo: _hdinfo } call.succ(changedata); From 29f7133f10ec6628fd18f1b5647b2137b40bd3d6 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Sat, 6 Jan 2024 17:30:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E6=B4=BB=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fix_patch/patch_20240106.ts | 98 +++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/fix_patch/patch_20240106.ts diff --git a/src/fix_patch/patch_20240106.ts b/src/fix_patch/patch_20240106.ts new file mode 100644 index 0000000..beb25e3 --- /dev/null +++ b/src/fix_patch/patch_20240106.ts @@ -0,0 +1,98 @@ +import { log } from "console"; +import { patchFun, patchInit } from "../patch"; +import { TanXianFun } from "../public/tanxian"; +import { PublicShared } from "../shared/public/public"; + +class Path { + + async fun1(a: any) { + let hd = [{ + "hdid": 3001, // 唯一活动id 传说之路 + "htype": 3, // 后端唯一识别标识 + "stype": 300, // 前端唯一识别标识(看前端需要是否修改) + "ttype": 1, // 0 按照开服时间计算,1 玩家注册时间计算 4 屏蔽此活动 + "stime": 30, // 活动开始天数 + "rtime": 60, // 活动显示结束天数 + "etime": 60, // 活动实际结束 + "name": "xinfupeiyang", + "icon": "icon_qiridenglu", + "showtime": "仅供参考,会复写正确值", + "data": { + //干部id + hid: '5002', + //任务 + task: [ + { idx: 0, total: 80, type: 'lv', prize: [{ a: 'item', t: '1', n: 500000 }], des: 'intr_cszl_des_2' }, + { idx: 1, total: 4, type: 'jieji', prize: [{ a: 'item', t: '12', n: 500 }], des: 'intr_cszl_des_1' }, + { idx: 2, total: 120, type: 'lv', prize: [{ a: 'item', t: '1', n: 500000 }], des: 'intr_cszl_des_2' }, + { idx: 3, total: 5, type: 'jieji', prize: [{ a: 'item', t: '12', n: 1000 }], des: 'intr_cszl_des_1' }, + { idx: 4, total: 160, type: 'lv', prize: [{ a: 'item', t: '1', n: 800000 }], des: 'intr_cszl_des_2' }, + { idx: 5, total: 6, type: 'jieji', prize: [{ a: 'item', t: '12', n: 1500 }], des: 'intr_cszl_des_1' }, + { idx: 6, total: 200, type: 'lv', prize: [{ a: 'item', t: '1', n: 1200000 }], des: 'intr_cszl_des_2' }, + { idx: 7, total: 7, type: 'jieji', prize: [{ a: 'item', t: '12', n: 2000 }], des: 'intr_cszl_des_1' }, + { idx: 8, total: 240, type: 'lv', prize: [{ a: 'item', t: '1', n: 2000000 }], des: 'intr_cszl_des_2' }, + { idx: 9, total: 8, type: 'jieji', prize: [{ a: 'item', t: '5002', n: 20 }], des: 'intr_cszl_des_1' } + ], + //宝箱 + box: { total: 10, prize: [{ a: 'item', t: '610', n: 1 }] } + } + }, + { + "hdid": 3002, // 唯一活动id 传说之路 心腹培养 + "htype": 3, // 后端唯一识别标识 + "stype": 300, // 前端唯一识别标识(看前端需要是否修改) + "ttype": 1, // 0 按照开服时间计算,1 玩家注册时间计算 4 屏蔽此活动 + "stime": 60, // 活动开始天数 + "rtime": 90, // 活动显示结束天数 + "etime": 90, // 活动实际结束 + "name": "xinfupeiyang", + "icon": "icon_xfdj", + "showtime": "仅供参考,会复写正确值", + "data": { + //干部id + hid: '5004', + //任务 + task: [ + { idx: 0, total: 100, type: 'lv', prize: [{ a: 'item', t: '1', n: 500000 }], des: 'intr_cszl_des_2' }, + { idx: 1, total: 5, type: 'jieji', prize: [{ a: 'item', t: '12', n: 500 }], des: 'intr_cszl_des_1' }, + { idx: 2, total: 140, type: 'lv', prize: [{ a: 'item', t: '1', n: 500000 }], des: 'intr_cszl_des_2' }, + { idx: 3, total: 6, type: 'jieji', prize: [{ a: 'item', t: '12', n: 1000 }], des: 'intr_cszl_des_1' }, + { idx: 4, total: 180, type: 'lv', prize: [{ a: 'item', t: '1', n: 800000 }], des: 'intr_cszl_des_2' }, + { idx: 5, total: 7, type: 'jieji', prize: [{ a: 'item', t: '12', n: 1500 }], des: 'intr_cszl_des_1' }, + { idx: 6, total: 220, type: 'lv', prize: [{ a: 'item', t: '1', n: 1200000 }], des: 'intr_cszl_des_2' }, + { idx: 7, total: 8, type: 'jieji', prize: [{ a: 'item', t: '12', n: 2000 }], des: 'intr_cszl_des_1' }, + { idx: 8, total: 260, type: 'lv', prize: [{ a: 'item', t: '1', n: 2000000 }], des: 'intr_cszl_des_2' }, + { idx: 9, total: 9, type: 'jieji', prize: [{ a: 'item', t: '5004', n: 20 }], des: 'intr_cszl_des_1' } + ], + //宝箱 + box: { total: 10, prize: [{ a: 'item', t: '610', n: 1 }] } + } + }] + + for (let i = 0; i < hd.length; i++) { + G.mongodb.collection('hdinfo').updateOne( + { hdid: hd[i].hdid }, { $set: { ["data.task"]: hd[i].data.task } }, { upsert: true } + ) + } + + return "sucess!!!" + } + + + + async run() { + await this.fun1(1); + } +} + +async function main() { + await patchInit() + let patch = new Path(); + await patch.run(); + console.log("逻辑执行完成,等待退出"); + setTimeout(function () { + console.log('结束程序'); + process.exit(); + }, 3000); +} +main(); From 35d51a3811b96bbb822c9d422ad260b4a81f4de6 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Sat, 6 Jan 2024 17:39:32 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=85=BB=E6=88=90=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yangchengmubiao/ApiOpen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts index 611e38e..e96c131 100644 --- a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts +++ b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts @@ -18,7 +18,7 @@ export default async function (call: ApiCall) { for (let payid in payLogs) { if (payLogs[payid].length > 0) { - if (payIds[payIds].slice(-1)[0].time < _hdinfo.stime) { + if (payLogs[payIds].slice(-1)[0].time < _hdinfo.stime) { delPay.push({ payId: payid, val: [] }); } } From b354c613581e0b1b097a17de25ac503e455cf774 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Sat, 6 Jan 2024 17:51:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E5=85=BB=E6=88=90=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yangchengmubiao/ApiOpen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts index e96c131..d9b4366 100644 --- a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts +++ b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts @@ -18,7 +18,7 @@ export default async function (call: ApiCall) { for (let payid in payLogs) { if (payLogs[payid].length > 0) { - if (payLogs[payIds].slice(-1)[0].time < _hdinfo.stime) { + if (payLogs[payid].slice(-1)[0].time < _hdinfo.stime) { delPay.push({ payId: payid, val: [] }); } }