From 39362ea6abba852f3990f8520f55f277ab3605d3 Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 14 Dec 2023 17:53:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E6=9C=AB=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/zhoumolibao/ApiOpen.ts | 2 -- src/public/pay.ts | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api_s2c/event/zhoumolibao/ApiOpen.ts b/src/api_s2c/event/zhoumolibao/ApiOpen.ts index 2a5bdbd..7bed3a6 100644 --- a/src/api_s2c/event/zhoumolibao/ApiOpen.ts +++ b/src/api_s2c/event/zhoumolibao/ApiOpen.ts @@ -12,8 +12,6 @@ export default async function (call: ApiCall) { let _hd = (await HuoDongFun.gethdList(call, 9))[0] let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) - await checkResetBuyLog(call) - await getConf(call) call.succ({ record: data?.record || {}, diff --git a/src/public/pay.ts b/src/public/pay.ts index dc5bda5..8c48aa5 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -99,7 +99,7 @@ export class PayFun { }).toArray(); if (payIds?.length) { - return Object.fromEntries(payIds.map(id => [id, logs[id] || []])); + return Object.fromEntries(payIds.map(id => [id, logs.find(i => i.key == id)?.values || []])); } let allLogs = {} logs.map(i => allLogs[i.key] = i.values) @@ -372,7 +372,11 @@ export class PayFun { } if (conf.buys > 0 && buyLog.length >= conf.buys) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1}); - if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2}); + + // todo 没看懂这个判断针对什么支付,不支持周末礼包这个类型的限购,所以加上判断:payId.indexOf('wkdlibao') == -1 + if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0 && payId.indexOf('wkdlibao') == -1) { + return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2}); + } if (payId.indexOf('136Gift') != -1 && payId != '136Gift1') { buyLog = await this.getPayLog(player.uid, '136Gift1'); if (buyLog.slice(-1)[0]?.eTime > G.time) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -3});