元旦活动

This commit is contained in:
dy 2023-12-25 17:13:59 +08:00
parent cba4f4563d
commit 1d6143794c
4 changed files with 8 additions and 16 deletions

View File

@ -2,15 +2,12 @@ import {ApiCall} from "tsrpc";
import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen"; import {ReqDMOpen, ResDMOpen} from "../../../shared/protocols/event/yuandan/PtlDMOpen";
import {HuoDongFun} from "../../../public/huodongfun"; import {HuoDongFun} from "../../../public/huodongfun";
import {PayFun} from "../../../public/pay"; import {PayFun} from "../../../public/pay";
import {Yuandanfun} from "./fun";
export default async function (call: ApiCall<ReqDMOpen, ResDMOpen>) { export default async function (call: ApiCall<ReqDMOpen, ResDMOpen>) {
let data = await G.mongodb.cEvent('yuandandamo').findOne({uid: call.uid, type: 'yuandandamo'}) let _hd = await Yuandanfun.getCon(call)
let _hd = (await HuoDongFun.gethdList(call, 14))[0]
let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId)
call.succ({ call.succ({
record: data?.record || {} data: (await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: 'yuandandamo'})) || {}
}) })
} }

View File

@ -8,14 +8,9 @@ import {PlayerFun} from "../../../public/player";
export class Yuandanfun { export class Yuandanfun {
/**配置 */ /**配置 */
static async getCon(call: ApiCall) { static async getCon(call: ApiCall) {
let _con: { [id: string]: ReqAddHuoDong } = {} let _hd = (await HuoDongFun.gethdList(call, 14))[0]
let _hd = await HuoDongFun.gethdList(call, 8) if (!_hd) return call.errorCode(-1)
for (let index = 0; index < _hd.length; index++) { return _hd
const element = _hd[index];
if (element && element._id) delete element._id
_con[element.hdid] = element
}
return _con
} }
/**获取所有符合时间的活动 */ /**获取所有符合时间的活动 */

View File

@ -7,7 +7,7 @@ export type ReqDMOpen = {
}; };
export type ResDMOpen = { export type ResDMOpen = {
record:{ data:{
[k: string]: any; [k: string]: any;
} }
}; };

View File

@ -11426,7 +11426,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
"properties": [ "properties": [
{ {
"id": 0, "id": 0,
"name": "record", "name": "myData",
"type": { "type": {
"type": "Interface", "type": "Interface",
"indexSignature": { "indexSignature": {