This commit is contained in:
dy 2023-12-31 11:45:44 +08:00
parent 96675a9ff1
commit a84f20361f
2 changed files with 2 additions and 2 deletions

View File

@ -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}

View File

@ -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'}