This commit is contained in:
undefined committed 2021-04-21 23:14:00 +08:00
1 parent 31f7d9a643
commit b49a2fde74
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ class RecordModel {
const pending = await task.count({ uid });
const timeRecent = await RecordModel.coll
.find({ _id: { $gte: Time.getObjectID(moment().add(-1, 'hour')) }, uid }).project({ time: 1 }).toArray();
return -(pending * (sum(timeRecent) / 1000));
return -(pending * (sum(timeRecent.map((i) => i.time || 0)) / 1000));
}
static async get(domainId: string, _id: ObjectID): Promise<Rdoc | null> {