fix: 解决冲突

pull/12736/head
Bai 2024-02-29 16:37:10 +08:00
commit f10114c9ed
1 changed files with 2 additions and 2 deletions

View File

@ -182,14 +182,14 @@ class DatesLoginMetricMixin:
def get_dates_login_times_assets(self):
assets = self.sessions_queryset.values("asset") \
.annotate(total=Count("asset")) \
.annotate(total=Count("asset", distinct=True)) \
.annotate(last=Cast(Max("date_start"), output_field=CharField())) \
.order_by("-total")
return list(assets[:10])
def get_dates_login_times_users(self):
users = self.sessions_queryset.values("user_id") \
.annotate(total=Count("user_id")) \
.annotate(total=Count("user_id", distinct=True)) \
.annotate(user=Max('user')) \
.annotate(last=Cast(Max("date_start"), output_field=CharField())) \
.order_by("-total")