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