From 2d62a387b6460e46de2cb0f7934e09027b5b86ae Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Sat, 6 Jan 2024 17:30:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BB=E6=88=90=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E7=A4=BC=E5=8C=85=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yangchengmubiao/ApiOpen.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts index 89f91a9..611e38e 100644 --- a/src/api_s2c/event/yangchengmubiao/ApiOpen.ts +++ b/src/api_s2c/event/yangchengmubiao/ApiOpen.ts @@ -2,6 +2,8 @@ import { ApiCall } from "tsrpc"; import { HuoDongFun } from "../../../public/huodongfun"; import { ReqOpen, ResOpen } from "../../../shared/protocols/event/yangchengmubiao/PtlOpen"; import { YangChengMuBiaofun } from "./fun"; +import { PayFun } from "../../../public/pay"; +import { payLog } from "../../../shared/protocols/pay/PtlGetList"; export default async function (call: ApiCall) { let _hdinfo = await HuoDongFun.getHdidInfo(call, call.req.hdid) @@ -9,6 +11,23 @@ export default async function (call: ApiCall) { // 无此活动 return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 }) } + + let delPay: { payId: string, val: payLog[] }[] = []; + let payIds = _hdinfo.data.gift.map(v => v.payId); + let payLogs = await PayFun.getPayLogs(call.uid, payIds); + + for (let payid in payLogs) { + if (payLogs[payid].length > 0) { + if (payIds[payIds].slice(-1)[0].time < _hdinfo.stime) { + delPay.push({ payId: payid, val: [] }); + } + } + } + + if (delPay.length > 0) { + await PayFun.delPayLog(call.uid, ...delPay); + } + let _mydata = await YangChengMuBiaofun.getMyData(call, call.req.hdid) let changedata = { mydata: _mydata, hdinfo: _hdinfo } call.succ(changedata);