fix round
This commit is contained in:
parent
3899b9157c
commit
d2ddc62752
@ -25,8 +25,8 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||
}
|
||||
db = await checkNextRound(call, db, _hdinfo.data.tasks)
|
||||
|
||||
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.rtime)) * 10
|
||||
payNum = payNum - (db.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
|
||||
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.etime)) * 10
|
||||
payNum = payNum - (db?.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
|
||||
|
||||
call.succ({
|
||||
sTime: sTime,
|
||||
|
@ -40,8 +40,9 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
|
||||
}
|
||||
|
||||
export async function checkNextRound(call: ApiCall, event, tasks) {
|
||||
let _dbType: `leijichongzhi${number}` = `leijichongzhi${call.req.hdid}`
|
||||
if ((event?.recIndex?.length || 0) < tasks.length) return event
|
||||
|
||||
let _dbType: `leijichongzhi${number}` = `leijichongzhi${call.req.hdid}`
|
||||
return (await G.mongodb.cEvent(_dbType).findOneAndUpdate(
|
||||
{uid: call.uid, type: _dbType},
|
||||
{$set: {recIndex: []}, $inc: {round: 1}}, {returnDocument: 'after'}
|
||||
|
Loading…
Reference in New Issue
Block a user