fix: 修复Dashboard活跃用户数据不准确问题

pull/6145/head
Bai 2021-05-19 17:47:21 +08:00 committed by Jiangjie.Bai
parent 77b4847bd9
commit f7f9331c48
1 changed files with 1 additions and 0 deletions

View File

@ -189,6 +189,7 @@ class DatesLoginMetricMixin:
def get_dates_login_times_top10_users(self):
users = self.sessions_queryset.values("user_id") \
.annotate(total=Count("user_id")) \
.annotate(user=Max('user')) \
.annotate(last=Max("date_start")).order_by("-total")[:10]
for user in users:
user['last'] = str(user['last'])