From 65417fb8bdc7f1b0649fa0f38aa6d3dfed6a8afe Mon Sep 17 00:00:00 2001 From: dy Date: Sat, 30 Dec 2023 10:26:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=E6=95=B0=E6=8D=AE=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/fun.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api_s2c/event/yuandan/fun.ts b/src/api_s2c/event/yuandan/fun.ts index b09da3d..fd4c5e2 100644 --- a/src/api_s2c/event/yuandan/fun.ts +++ b/src/api_s2c/event/yuandan/fun.ts @@ -35,7 +35,7 @@ export class Yuandanfun { static async refreshPayLog(call: ApiCall) { let _hd = await this.getCon(call) - let payIds = _hd?.data?.gift?.filter(i=>i.payId).map(i=>i.payId) + let payIds = _hd?.data?.gift?.filter(i => i.payId).map(i => i.payId) PayFun.delPayLog(call.uid, ...payIds.map(i => { return {payId: i, val: []} })) @@ -74,7 +74,8 @@ export class Yuandanfun { let _hd = await this.getCon(call) if (!_hd) return - // let _mydata = await Christmasfun.getMyData(call, hdid) + await this.getData(call, _hd.hdid) + let _tasks = _hd.data.task let _setData = { @@ -88,7 +89,6 @@ export class Yuandanfun { let _taskCon = _tasks[ele] if (_taskCon.stype != stype) continue - let _pval = _taskCon.pval // 不符合任务要求 if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue @@ -105,10 +105,10 @@ export class Yuandanfun { // 设置任务 if (isset == 1) { - await G.mongodb.collection('event').updateOne( - {uid: call.uid, type: `yuandan${_hd.hdid}`}, - _setData - ) + await G.mongodb.collection('event').updateOne({ + uid: call.uid, + type: `yuandan${_hd.hdid}` + }, _setData) } } From ca4616e4de9cc9b1c492c43cd228d7fca352ad52 Mon Sep 17 00:00:00 2001 From: dy Date: Sat, 30 Dec 2023 10:41:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiOpen.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts index d077d62..c3ae986 100644 --- a/src/api_s2c/event/yuandan/ApiOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -3,14 +3,18 @@ import {ReqOpen, ResOpen} from "../../../shared/protocols/event/yuandan/PtlOpen" import {HuoDongFun} from "../../../public/huodongfun"; import {PayFun} from "../../../public/pay"; import {Yuandanfun} from "./fun"; +import {PublicShared} from "../../../shared/public/public"; export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) + if (!_hd) return call.errorCode(-1) let payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid) + let data = await Yuandanfun.getData(call, _hd.hdid) + call.succ({ - data: await Yuandanfun.getData(call, _hd.hdid), - payLog: await PayFun.getPayLogs(call.uid, payIds) + data: {...data, isSameDay: PublicShared.chkSameDate(data.qiandaoTime, G.time)}, + payLog: await PayFun.getPayLogs(call.uid, payIds), }) } \ No newline at end of file From d03d8a8399d4e481d11899982cfe97e23552881f Mon Sep 17 00:00:00 2001 From: dy Date: Sat, 30 Dec 2023 10:41:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiOpen.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiOpen.ts b/src/api_s2c/event/yuandan/ApiOpen.ts index d077d62..c3ae986 100644 --- a/src/api_s2c/event/yuandan/ApiOpen.ts +++ b/src/api_s2c/event/yuandan/ApiOpen.ts @@ -3,14 +3,18 @@ import {ReqOpen, ResOpen} from "../../../shared/protocols/event/yuandan/PtlOpen" import {HuoDongFun} from "../../../public/huodongfun"; import {PayFun} from "../../../public/pay"; import {Yuandanfun} from "./fun"; +import {PublicShared} from "../../../shared/public/public"; export default async function (call: ApiCall) { let _hd = await Yuandanfun.getCon(call) + if (!_hd) return call.errorCode(-1) let payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid) + let data = await Yuandanfun.getData(call, _hd.hdid) + call.succ({ - data: await Yuandanfun.getData(call, _hd.hdid), - payLog: await PayFun.getPayLogs(call.uid, payIds) + data: {...data, isSameDay: PublicShared.chkSameDate(data.qiandaoTime, G.time)}, + payLog: await PayFun.getPayLogs(call.uid, payIds), }) } \ No newline at end of file