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}); } }