From 39cb12ac9aa040d344d4353ffc426c7ef2a12e04 Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 14 Dec 2023 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E6=9C=AB=E7=A4=BC=E5=8C=85=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E8=A1=A5=E9=92=BB=E7=9F=B3=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/zhoumolibao/ApiReceive.ts | 1 - src/public/pay.ts | 24 ++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/api_s2c/event/zhoumolibao/ApiReceive.ts b/src/api_s2c/event/zhoumolibao/ApiReceive.ts index 5a7c528..f9ded9e 100644 --- a/src/api_s2c/event/zhoumolibao/ApiReceive.ts +++ b/src/api_s2c/event/zhoumolibao/ApiReceive.ts @@ -21,5 +21,4 @@ export default async function (call: ApiCall) { },{ upsert: true }) call.succ({}) - } diff --git a/src/public/pay.ts b/src/public/pay.ts index aab3b30..dc5bda5 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -177,13 +177,6 @@ export class PayFun { let conf: any = await this.getConf(payId, payArgs); - let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs) - if (isReplaceConf) { - let prizePayId = `zuanshi_${conf.money}` - payArgs.toPrizePayId = prizePayId - conf = this.replacePrizeToChongzhi(prizePayId, conf) - } - let prize = [...conf.prize]; //let player = await G.redis.get('user', uid); let player = await getGud(uid); @@ -226,6 +219,22 @@ export class PayFun { } }); } + + if (payId.indexOf('wkdlibao') != -1) { + let call = this.getCall(player) + let conf = await zmlbGetConf(call, {payId}) + prize.push(...conf.prize) + } + + let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs) + if (isReplaceConf) { + let prizePayId = `zuanshi_${conf.money}` + payArgs.toPrizePayId = prizePayId + conf = this.replacePrizeToChongzhi(prizePayId, conf) + prize = [...conf.prize] + } + + await PlayerFun.sendPrize(call, prize); await PlayerFun.addAttr(call, conf.payExp); if (payId == 'G123SendGift') { @@ -371,7 +380,6 @@ export class PayFun { if (payId.indexOf('wkdlibao') != -1) { let call = this.getCall(player) let conf = await zmlbGetConf(call, {payId}) - buyLog = await this.getPayLog(player.uid, payId); if (buyLog.length && buyLog.length >= conf.buyNum) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1}); } }