Merge branch 'bugfix' of http://git.legu.cc/qixin/HJ_Server into bugfix
This commit is contained in:
commit
f99d556736
@ -29,5 +29,5 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
|||||||
|
|
||||||
call.succ({})
|
call.succ({})
|
||||||
|
|
||||||
HongDianChange.sendChangeKey(call.uid, ['pobinglibao']);
|
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);
|
||||||
}
|
}
|
||||||
|
@ -367,17 +367,21 @@ export class HuoDongHongDianFun {
|
|||||||
/**破冰礼包红点 */
|
/**破冰礼包红点 */
|
||||||
static async pobinglibao(call: ApiCall, _hd: ReqAddHuoDong): Promise<hongdianVal> {
|
static async pobinglibao(call: ApiCall, _hd: ReqAddHuoDong): Promise<hongdianVal> {
|
||||||
let gift = _hd?.data?.gift?.find(i => i.free == true && !i.payId)
|
let gift = _hd?.data?.gift?.find(i => i.free == true && !i.payId)
|
||||||
if (!gift) return {show: false}
|
if (gift) return {show: true}
|
||||||
|
|
||||||
let payLog = await PayFun.getPayLog(call.uid, gift.payId)
|
let payIds = _hd?.data?.gift?.filter(i=>i.payId).map(i=>i.payId)
|
||||||
payLog = payLog?.filter(i => i.time >= _hd.stime && i.time <= _hd.etime) || []
|
let payLogs = await PayFun.getPayLogs(call.uid, payIds)
|
||||||
if (!payLog || !payLog.length) return {show: false}
|
|
||||||
|
|
||||||
// 取奖励列表,判断是否有可领取奖励
|
// 取奖励列表,判断是否有可领取奖励
|
||||||
let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'})
|
let data = await G.mongodb.cEvent('pobinglibao').findOne({uid: call.uid, type: 'pobinglibao'})
|
||||||
let rec = data?.record?.[call.req.id].length
|
|
||||||
if (rec && (rec >= 3 || data?.record?.[gift.id] == call.req.recId)) return {show: false}
|
for (let item of _hd?.data?.gift){
|
||||||
return {show: true}
|
let rec = data?.record?.[item.id]?.length
|
||||||
|
if (item.free== true && !item.payId) return {show: true}
|
||||||
|
if (payLogs[item.payId]?.length && (!rec || rec < PublicShared.getDiff(payLogs[item.payId][0].time))) return {show: true}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {show:false}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**元旦活动红点 */
|
/**元旦活动红点 */
|
||||||
|
Loading…
Reference in New Issue
Block a user