Compare commits
No commits in common. "3e1c45aaf969fb0039faa164fc434539f9f5e1a8" and "a5e726e8116bcc41bc81b27f1de7ecda40c27e5d" have entirely different histories.
3e1c45aaf9
...
a5e726e811
@ -6,6 +6,7 @@ import {PublicShared} from "../../../shared/public/public";
|
|||||||
|
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||||
|
let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'})
|
||||||
|
|
||||||
let _hd = (await HuoDongFun.gethdList(call, 10))[0]
|
let _hd = (await HuoDongFun.gethdList(call, 10))[0]
|
||||||
if (!_hd) return call.errorCode(-1)
|
if (!_hd) return call.errorCode(-1)
|
||||||
@ -15,11 +16,9 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
|||||||
let payLog: any = await PayFun.getPayLogs(call.uid, payIds)
|
let payLog: any = await PayFun.getPayLogs(call.uid, payIds)
|
||||||
|
|
||||||
for (let key in payLog) {
|
for (let key in payLog) {
|
||||||
payLog[key] = payLog[key]?.filter(i => i.time > _hd.stime && i.time < _hd.etime)
|
payLog[key]?.filter(i => i.time > _hd.stime && i.time < _hd.etime)
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = await G.mongodb.cEvent(`pobinglibao${_hd.hdid}`).findOne({uid: call.uid, type: `pobinglibao${_hd.hdid}`})
|
|
||||||
|
|
||||||
call.succ({
|
call.succ({
|
||||||
record: data?.record || {},
|
record: data?.record || {},
|
||||||
buyLog: payLog
|
buyLog: payLog
|
||||||
|
@ -7,27 +7,30 @@ import {PayFun} from "../../../public/pay";
|
|||||||
|
|
||||||
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
||||||
|
|
||||||
|
if (!call.req.id) return call.errorCode(-1)
|
||||||
|
|
||||||
// 查询活动是否有当前领奖的免费选项
|
// 查询活动是否有当前领奖的免费选项
|
||||||
let _hd = (await HuoDongFun.gethdList(call, 10))[0]
|
let _hd = (await HuoDongFun.gethdList(call, 10))[0]
|
||||||
let gift = _hd?.data?.gift?.find(i => i.id == call.req.id)
|
let gift = _hd?.data?.gift?.find(i => i.id == call.req.id)
|
||||||
if (!gift || !call.req.recId) return call.errorCode(-1)
|
if (!gift) return call.errorCode(-1)
|
||||||
|
|
||||||
let payLog = await PayFun.getPayLog(call.uid, gift.payId)
|
let payLog = await PayFun.getPayLog(call.uid, gift.payId)
|
||||||
payLog = payLog?.filter(i => i.time >= _hd.stime && i.time <= _hd.etime) || []
|
payLog = payLog?.filter(i => i.time >= _hd.stime && i.time <= _hd.etime) || []
|
||||||
if (!payLog || !payLog.length) return call.errorCode(-2)
|
if (!payLog || !payLog.length) return call.errorCode(-2)
|
||||||
|
|
||||||
|
|
||||||
// 取奖励列表,判断是否有可领取奖励
|
// 取奖励列表,判断是否有可领取奖励
|
||||||
let data = await G.mongodb.cEvent(`pobinglibao${_hd.hdid}`).findOne({uid: call.uid, type: `pobinglibao${_hd.hdid}`})
|
let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'})
|
||||||
let rec = data?.record?.[call.req.id]?.length
|
let rec = data?.record?.[call.req.id]?.length
|
||||||
if (rec && (rec >= 3 || data?.record?.[gift.id] == call.req.recId)) return call.errorCode(-3)
|
if (rec && (rec >= 3 || data?.record?.[gift.id] == call.req.recId)) return call.errorCode(-3)
|
||||||
|
|
||||||
await PlayerFun.sendPrize(call, gift[call.req.recId]);
|
await PlayerFun.sendPrize(call, gift[call.req.recId]);
|
||||||
|
|
||||||
await G.mongodb.cEvent(`pobinglibao${_hd.hdid}`).updateOne({uid: call.uid, type: `pobinglibao${_hd.hdid}`}, {
|
await G.mongodb.cEvent('pobinglibao').updateOne({uid: call.uid, type: 'pobinglibao'}, {
|
||||||
$push: {[`record.${gift.id}`]: call.req.recId},
|
$push: {[`record.${gift.id}`]: call.req.recId},
|
||||||
}, {upsert: true})
|
}, {upsert: true})
|
||||||
|
|
||||||
call.succ({prize: gift[call.req.recId]})
|
call.succ({})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ export class HuoDongHongDianFun {
|
|||||||
let payLogs = await PayFun.getPayLogs(call.uid, payIds)
|
let payLogs = await PayFun.getPayLogs(call.uid, payIds)
|
||||||
|
|
||||||
// 取奖励列表,判断是否有可领取奖励
|
// 取奖励列表,判断是否有可领取奖励
|
||||||
let data = await G.mongodb.cEvent(`pobinglibao${_hd.hdid}`).findOne({uid: call.uid, type: `pobinglibao${_hd.hdid}`})
|
let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'})
|
||||||
|
|
||||||
for (let item of _hd?.data?.gift){
|
for (let item of _hd?.data?.gift){
|
||||||
let rec = data?.record?.[item.id]?.length
|
let rec = data?.record?.[item.id]?.length
|
||||||
|
@ -54,6 +54,7 @@ export type eventType = {
|
|||||||
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
jierihuodong: Omit<ResOpenJierihuodong, 'taskFinish'> & { refreshTime: number; };
|
||||||
kaifujingsai: ResOpenKaifujingsai;
|
kaifujingsai: ResOpenKaifujingsai;
|
||||||
zhoumolibao: ResOpenZhoumolibao & { refreshTime: number; };
|
zhoumolibao: ResOpenZhoumolibao & { refreshTime: number; };
|
||||||
|
pobinglibao: ResOpenPobinglibao
|
||||||
payForDiamond: {
|
payForDiamond: {
|
||||||
[time: number]: number
|
[time: number]: number
|
||||||
}
|
}
|
||||||
@ -73,7 +74,6 @@ export type eventType = {
|
|||||||
[k: `qiridenglu${number}`]: Pick<ResOpenQiridenglu, 'recPrize'>;
|
[k: `qiridenglu${number}`]: Pick<ResOpenQiridenglu, 'recPrize'>;
|
||||||
[k: `leichonglibao${number}`]: ResOpenLeiChongLiBao & { opentime: number };
|
[k: `leichonglibao${number}`]: ResOpenLeiChongLiBao & { opentime: number };
|
||||||
[k: `yuandan${number}`]: ResOpenYuandan;
|
[k: `yuandan${number}`]: ResOpenYuandan;
|
||||||
[k: `pobinglibao${number}`]: ResOpenPobinglibao;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CollectionEvent<T extends keyof eventType> = {
|
export type CollectionEvent<T extends keyof eventType> = {
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import {prizeType} from "../../type";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 破冰礼包领奖
|
* 破冰礼包领奖
|
||||||
*/
|
*/
|
||||||
export type ReqReceive = {
|
export interface ReqReceive {
|
||||||
id: string
|
id: string
|
||||||
recId: string
|
recId: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ResReceive = {
|
export interface ResReceive {
|
||||||
prize: prizeType[]
|
|
||||||
}
|
}
|
||||||
|
@ -10560,20 +10560,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"event/pobinglibao/PtlReceive/ResReceive": {
|
"event/pobinglibao/PtlReceive/ResReceive": {
|
||||||
"type": "Interface",
|
"type": "Interface"
|
||||||
"properties": [
|
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"name": "prize",
|
|
||||||
"type": {
|
|
||||||
"type": "Array",
|
|
||||||
"elementType": {
|
|
||||||
"type": "Reference",
|
|
||||||
"target": "type/prizeType"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"event/qirichongzhi/PtlOpen/ReqOpen": {
|
"event/qirichongzhi/PtlOpen/ReqOpen": {
|
||||||
"type": "Interface"
|
"type": "Interface"
|
||||||
|
Loading…
Reference in New Issue
Block a user