From 36b15af077c1482a5d8b7cd56f7ff24f95103c74 Mon Sep 17 00:00:00 2001 From: chenkai Date: Fri, 22 Dec 2023 16:34:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20price=20=E5=9B=9E?= =?UTF-8?q?=E5=8F=82=E8=A1=A8=E7=A4=BA=E9=A2=86=E5=8F=96=E9=97=A8=E6=A7=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/payForDiamond/ApiCanReceive.ts | 15 ++++++++------- .../event/payForDiamond/PtlCanReceive.ts | 1 + src/shared/protocols/serviceProto.ts | 7 +++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/api_s2c/event/payForDiamond/ApiCanReceive.ts b/src/api_s2c/event/payForDiamond/ApiCanReceive.ts index 77f79fc..feb4f1a 100644 --- a/src/api_s2c/event/payForDiamond/ApiCanReceive.ts +++ b/src/api_s2c/event/payForDiamond/ApiCanReceive.ts @@ -13,16 +13,17 @@ export async function playerCanReceive(call: ApiCall) { const showOffList = activityInfo.data['showOffList'] || []; const zeroTime = PublicShared.getToDayZeroTime(); const vipScore = await ActionLog.getDayLog(call.uid, 'pay'); + const price = activityInfo.data['price']; if (!vipScore) { return { - payNum: 0, remaining, result: false, activityInfo, showOffList + payNum: 0, remaining, result: false, activityInfo, showOffList, price }; } const payNum = vipScore; // 玩家充值未达标或者奖池余额耗尽则不能领取 - if (payNum < activityInfo.data['price'] || remaining <= 0) { + if (payNum < price || remaining <= 0) { return { - payNum, remaining, result: false, activityInfo, showOffList + payNum, remaining, result: false, activityInfo, showOffList, price } } // 检查玩家今日是否已经领取 @@ -30,19 +31,19 @@ export async function playerCanReceive(call: ApiCall) { if (playerActivityInfo) { if (playerActivityInfo[zeroTime]) { return { - payNum, remaining, result: false, activityInfo, showOffList + payNum, remaining, result: false, activityInfo, showOffList, price }; } } return { - payNum, remaining, result: true, activityInfo, showOffList + payNum, remaining, result: true, activityInfo, showOffList, price }; } export default async function (call: ApiCall) { const canReceiveResult = await playerCanReceive(call); if (canReceiveResult) { - const { payNum, remaining, result, showOffList } = canReceiveResult; - call.succ({ payNum, remaining, result, showOffList }); + const { payNum, remaining, result, showOffList, price } = canReceiveResult; + call.succ({ payNum, remaining, result, showOffList, price }); } } \ No newline at end of file diff --git a/src/shared/protocols/event/payForDiamond/PtlCanReceive.ts b/src/shared/protocols/event/payForDiamond/PtlCanReceive.ts index e7c8b13..1683937 100644 --- a/src/shared/protocols/event/payForDiamond/PtlCanReceive.ts +++ b/src/shared/protocols/event/payForDiamond/PtlCanReceive.ts @@ -6,5 +6,6 @@ export type ResCanReceive = { payNum: number; remaining?: number; result: boolean; + price: number; showOffList: any[]; }; \ No newline at end of file diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index db94cdb..5c1f8cc 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -10144,6 +10144,13 @@ export const serviceProto: ServiceProto = { }, { "id": 3, + "name": "price", + "type": { + "type": "Number" + } + }, + { + "id": 4, "name": "showOffList", "type": { "type": "Array",