From 5969e323236508e867df83561d3c1f308bcb1325 Mon Sep 17 00:00:00 2001 From: xcy <871622040@qq.com> Date: Tue, 19 Dec 2023 19:00:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=E4=BC=99=E4=BC=B4=E6=8B=9B=E5=8B=9F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A1=E4=BB=B6=E8=87=B3=E5=B0=8A=E6=9C=88?= =?UTF-8?q?=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/huobanzhaomu/ApiOpen.ts | 29 ++++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/api_s2c/event/huobanzhaomu/ApiOpen.ts b/src/api_s2c/event/huobanzhaomu/ApiOpen.ts index 860e426..cbe74fe 100644 --- a/src/api_s2c/event/huobanzhaomu/ApiOpen.ts +++ b/src/api_s2c/event/huobanzhaomu/ApiOpen.ts @@ -1,14 +1,25 @@ -import { ApiCall } from "tsrpc"; -import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huobanzhaomu/PtlOpen"; +import {ApiCall} from "tsrpc"; +import {ReqOpen, ResOpen} from "../../../shared/protocols/event/huobanzhaomu/PtlOpen"; +import {PayFun} from "../../../public/pay"; +import {payLog} from "../../../shared/protocols/pay/PtlGetList"; export default async function (call: ApiCall) { - let db = await G.mongodb.cEvent('huobanzhaomu').findOne({ uid: call.uid, type: 'huobanzhaomu' }); + let db = await G.mongodb.cEvent('huobanzhaomu').findOne({uid: call.uid, type: 'huobanzhaomu'}); - call.succ({ - finish: Object.fromEntries(G.gc.huobanzhaomu.map((conf, i) => { - return [i, conf.gudKey ? call.conn.gud[conf.gudKey] >= conf.total : db?.rec?.length >= G.gc.huobanzhaomu.length - 1]; - })), - rec: db?.rec || [] - }); + let logs: payLog[]; + let finish: { [k: number]: boolean } = {}; + for (let i = 0; i < G.gc.huobanzhaomu.length; i++) { + let conf = G.gc.huobanzhaomu[i]; + if (conf.gudKey == "zhizunyueka") { + if (!logs) { + logs = await PayFun.getPayLog(call.uid, "zhizunyueka"); + } + finish[i] = !(logs.length < 0 || logs.slice(-1)[0].eTime < G.time); + } else { + finish[i] = call.conn.gud[conf.gudKey] >= conf.total; + } + } + + call.succ({finish: finish, rec: db?.rec || []}); } \ No newline at end of file From a969fb65df1c5f8451b686d34d9517dbc0081310 Mon Sep 17 00:00:00 2001 From: xcy <871622040@qq.com> Date: Tue, 19 Dec 2023 19:11:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E4=BC=99=E4=BC=B4=E6=8B=9B=E5=8B=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/huobanzhaomu/ApiOpen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api_s2c/event/huobanzhaomu/ApiOpen.ts b/src/api_s2c/event/huobanzhaomu/ApiOpen.ts index cbe74fe..2960c08 100644 --- a/src/api_s2c/event/huobanzhaomu/ApiOpen.ts +++ b/src/api_s2c/event/huobanzhaomu/ApiOpen.ts @@ -15,7 +15,7 @@ export default async function (call: ApiCall) { if (!logs) { logs = await PayFun.getPayLog(call.uid, "zhizunyueka"); } - finish[i] = !(logs.length < 0 || logs.slice(-1)[0].eTime < G.time); + finish[i] = !(logs.length <= 0 || logs.slice(-1)[0].eTime < G.time); } else { finish[i] = call.conn.gud[conf.gudKey] >= conf.total; } From c75f14d88ef796902adb5f23367f0570540792fb Mon Sep 17 00:00:00 2001 From: xcy <871622040@qq.com> Date: Tue, 19 Dec 2023 19:03:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=E4=BD=9C=E6=88=98=E7=89=B9=E6=9D=83?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=8D=E8=B4=B9=E5=BF=AB=E9=80=9F=E6=8E=A2?= =?UTF-8?q?=E9=99=A9=E6=AC=A1=E6=95=B02->5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/tequan.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/tequan.ts b/src/public/tequan.ts index 078097f..7482b71 100644 --- a/src/public/tequan.ts +++ b/src/public/tequan.ts @@ -15,6 +15,6 @@ export class TeQuanFun { return await this.getIsAcTive(call, 'qingbaotequan') ? 1 : 0; } static async getTxFreeNum(call: ApiCall) { - return await this.getIsAcTive(call, 'zuozhantequan') ? 2 : 0; + return await this.getIsAcTive(call, 'zuozhantequan') ? 5 : 0; } } \ No newline at end of file