Compare commits
No commits in common. "3488f61978f3aa0e2d9e0353e379b45b7ddb1c6c" and "e35e950e11b61c1beadc27453cc332691a21d7fd" have entirely different histories.
3488f61978
...
e35e950e11
@ -6,6 +6,7 @@ import {PublicShared} from "../../../shared/public/public";
|
||||
|
||||
|
||||
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||
|
||||
let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
|
||||
|
||||
let _hd = (await HuoDongFun.gethdList(call, 9))[0]
|
||||
@ -16,7 +17,6 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||
record: data?.record || {},
|
||||
buyLog: await PayFun.getPayLogs(call.uid, payIds)
|
||||
})
|
||||
checkResetBuyLog(call)
|
||||
}
|
||||
|
||||
export async function getConf(call, args?: { id?: string; payId?: string }) {
|
||||
@ -31,10 +31,10 @@ export async function checkResetBuyLog(call) {
|
||||
let zeroTime = PublicShared.getToDayZeroTime()
|
||||
|
||||
let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
|
||||
if (!data?.refreshTime || data?.refreshTime < zeroTime) {
|
||||
if (data?.refreshTime <= zeroTime) {
|
||||
G.mongodb.cEvent(`zhoumolibao`).updateOne(
|
||||
{uid: call.uid, type: `zhoumolibao`},
|
||||
{$set: {record: {}, refreshTime: G.time}},
|
||||
{$set: {record: {}}},
|
||||
{upsert: true}
|
||||
)
|
||||
}
|
||||
@ -43,7 +43,7 @@ export async function checkResetBuyLog(call) {
|
||||
|
||||
let payIds = gifts.filter(i => i.payId)?.map(i => i.payId)
|
||||
let payLogs = await PayFun.getPayLogs(call.uid, payIds)
|
||||
let payLogLength = R.flatten(R.values(payLogs)).filter(i => i.time < zeroTime).length
|
||||
let payLogLength = R.values(payLogs).filter(i => i.time < zeroTime).length
|
||||
if (payLogLength) {
|
||||
PayFun.delPayLog(call.uid, payIds.map(i => ({payId: i, val: []})))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user