元旦活动
This commit is contained in:
parent
cba4f4563d
commit
1d6143794c
@ -2,15 +2,12 @@ import {ApiCall} from "tsrpc";
|
||||
import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen";
|
||||
import {HuoDongFun} from "../../../public/huodongfun";
|
||||
import {PayFun} from "../../../public/pay";
|
||||
import {Yuandanfun} from "./fun";
|
||||
|
||||
export default async function (call: ApiCall<ReqDMOpen, ResDMOpen>) {
|
||||
let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'})
|
||||
|
||||
let _hd = (await HuoDongFun.gethdList(call, 14))[0]
|
||||
|
||||
let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId)
|
||||
let _hd = await Yuandanfun.getCon(call)
|
||||
|
||||
call.succ({
|
||||
record: data?.record || {}
|
||||
data: (await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: 'yuandandamo'})) || {}
|
||||
})
|
||||
}
|
@ -8,14 +8,9 @@ import {PlayerFun} from "../../../public/player";
|
||||
export class Yuandanfun {
|
||||
/**配置 */
|
||||
static async getCon(call: ApiCall) {
|
||||
let _con: { [id: string]: ReqAddHuoDong } = {}
|
||||
let _hd = await HuoDongFun.gethdList(call, 8)
|
||||
for (let index = 0; index < _hd.length; index++) {
|
||||
const element = _hd[index];
|
||||
if (element && element._id) delete element._id
|
||||
_con[element.hdid] = element
|
||||
}
|
||||
return _con
|
||||
let _hd = (await HuoDongFun.gethdList(call, 14))[0]
|
||||
if (!_hd) return call.errorCode(-1)
|
||||
return _hd
|
||||
}
|
||||
|
||||
/**获取所有符合时间的活动 */
|
||||
|
@ -7,7 +7,7 @@ export type ReqDMOpen = {
|
||||
};
|
||||
|
||||
export type ResDMOpen = {
|
||||
record:{
|
||||
data:{
|
||||
[k: string]: any;
|
||||
}
|
||||
};
|
@ -11426,7 +11426,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
||||
"properties": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "record",
|
||||
"name": "myData",
|
||||
"type": {
|
||||
"type": "Interface",
|
||||
"indexSignature": {
|
||||
|
Loading…
Reference in New Issue
Block a user