feat: modify analytics

This commit is contained in:
Chen, Tai-Lin committed 2023-12-11 21:13:06 +08:00
1 parent 61f627b125
commit 3e7092dbd6
3 files changed
+9 -4

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
/* eslint-disable object-shorthand */
/* eslint-disable func-names */
import { UserProfile, Quest } from '@linux-odyssey/models'
import { UserProfile } from '@linux-odyssey/models'
export function totalQuests() {
return UserProfile.aggregate([
@@ -98,7 +98,7 @@ export function questList() {
else: {
$round: [
{ $multiply: [{ $divide: ['$completed', '$started'] }, 100] },
2,
0,
],
},
},
@@ -107,7 +107,7 @@ export function questList() {
},
{
$sort: {
_id: 1, // 按任务ID升序排序
completed: -1,
},
},
])