累充
This commit is contained in:
parent
96675a9ff1
commit
a84f20361f
@ -17,7 +17,7 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||
let sTime = db?.sTime || PublicShared.getToDayZeroTime(G.time);
|
||||
|
||||
if (!db) {
|
||||
G.mongodb.cEvent(_dbType).updateOne(
|
||||
await G.mongodb.cEvent(_dbType).updateOne(
|
||||
{uid: call.uid, type: _dbType},
|
||||
{$set: {sTime: sTime, recIndex: []}},
|
||||
{upsert: true}
|
||||
|
@ -41,7 +41,7 @@ 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
|
||||
if ((event?.recIndex?.length || 0) < tasks.length) return event
|
||||
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