From 44be68a8ca75b27ad93d26064cab5359696af865 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 20 Dec 2023 18:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=B4=E5=86=B0=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/pobinglibao/ApiOpen.ts | 1 + src/api_s2c/event/pobinglibao/ApiReceive.ts | 4 ++-- src/api_s2c/hongdian/fun.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/event/pobinglibao/ApiOpen.ts b/src/api_s2c/event/pobinglibao/ApiOpen.ts index b97d08a..5677a06 100644 --- a/src/api_s2c/event/pobinglibao/ApiOpen.ts +++ b/src/api_s2c/event/pobinglibao/ApiOpen.ts @@ -9,6 +9,7 @@ export default async function (call: ApiCall) { let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'}) let _hd = (await HuoDongFun.gethdList(call, 10))[0] + if (!_hd) return call.errorCode(-1) let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) diff --git a/src/api_s2c/event/pobinglibao/ApiReceive.ts b/src/api_s2c/event/pobinglibao/ApiReceive.ts index a2edfa0..40fe868 100644 --- a/src/api_s2c/event/pobinglibao/ApiReceive.ts +++ b/src/api_s2c/event/pobinglibao/ApiReceive.ts @@ -19,9 +19,9 @@ export default async function (call: ApiCall) { // 取奖励列表,判断是否有可领取奖励 let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'}) let rec = data?.record?.[call.req.id].length - if (rec && (rec >= 2 || data?.record?.[gift.id] == call.req.recId)) return call.errorCode(-3) + if (rec && (rec >= 3 || data?.record?.[gift.id] == call.req.recId)) return call.errorCode(-3) - await PlayerFun.sendPrize(call, gift.prize); + await PlayerFun.sendPrize(call, gift[call.req.recId]); await G.mongodb.cEvent('pobinglibao').updateOne({uid: call.uid, type: 'pobinglibao'}, { $push: {[`record.${gift.id}`]: call.req.recId}, diff --git a/src/api_s2c/hongdian/fun.ts b/src/api_s2c/hongdian/fun.ts index d173a22..af9d85d 100644 --- a/src/api_s2c/hongdian/fun.ts +++ b/src/api_s2c/hongdian/fun.ts @@ -390,7 +390,7 @@ export class HuoDongHongDianFun { // 取奖励列表,判断是否有可领取奖励 let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'}) let rec = data?.record?.[call.req.id].length - if (rec && (rec >= 2 || data?.record?.[gift.id] == call.req.recId)) return {show: false} + if (rec && (rec >= 3 || data?.record?.[gift.id] == call.req.recId)) return {show: false} return {show: true} }