Compare commits

..

No commits in common. "a5da9e1522506dacfc073bccba82e4896828b3ad" and "6be02bee612c2b01bc5abfc5e5c5b71968a96f31" have entirely different histories.

2 changed files with 9 additions and 13 deletions

View File

@ -3,18 +3,14 @@ import {ReqOpen, ResOpen} from "../../../shared/protocols/event/yuandan/PtlOpen"
import {HuoDongFun} from "../../../public/huodongfun"; import {HuoDongFun} from "../../../public/huodongfun";
import {PayFun} from "../../../public/pay"; import {PayFun} from "../../../public/pay";
import {Yuandanfun} from "./fun"; import {Yuandanfun} from "./fun";
import {PublicShared} from "../../../shared/public/public";
export default async function (call: ApiCall<ReqOpen, ResOpen>) { export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let _hd = await Yuandanfun.getCon(call) 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 payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid)
let data = await Yuandanfun.getData(call, _hd.hdid)
call.succ({ call.succ({
data: {...data, isSameDay: PublicShared.chkSameDate(data.qiandaoTime, G.time)}, data: await Yuandanfun.getData(call, _hd.hdid),
payLog: await PayFun.getPayLogs(call.uid, payIds), payLog: await PayFun.getPayLogs(call.uid, payIds)
}) })
} }

View File

@ -35,7 +35,7 @@ export class Yuandanfun {
static async refreshPayLog(call: ApiCall) { static async refreshPayLog(call: ApiCall) {
let _hd = await this.getCon(call) 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 => { PayFun.delPayLog(call.uid, ...payIds.map(i => {
return {payId: i, val: []} return {payId: i, val: []}
})) }))
@ -74,8 +74,7 @@ export class Yuandanfun {
let _hd = await this.getCon(call) let _hd = await this.getCon(call)
if (!_hd) return if (!_hd) return
await this.getData(call, _hd.hdid) // let _mydata = await Christmasfun.getMyData(call, hdid)
let _tasks = _hd.data.task let _tasks = _hd.data.task
let _setData = { let _setData = {
@ -89,6 +88,7 @@ export class Yuandanfun {
let _taskCon = _tasks[ele] let _taskCon = _tasks[ele]
if (_taskCon.stype != stype) continue if (_taskCon.stype != stype) continue
let _pval = _taskCon.pval
// 不符合任务要求 // 不符合任务要求
if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue if (!(await chkCall(_taskCon["cond"], chkval, arg))) continue
@ -105,10 +105,10 @@ export class Yuandanfun {
// 设置任务 // 设置任务
if (isset == 1) { if (isset == 1) {
await G.mongodb.collection('event').updateOne({ await G.mongodb.collection('event').updateOne(
uid: call.uid, {uid: call.uid, type: `yuandan${_hd.hdid}`},
type: `yuandan${_hd.hdid}` _setData
}, _setData) )
} }
} }