mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-03 08:25:04 +00:00
perf: 修复 Count 时没有去重的问题
This commit is contained in:
@@ -246,6 +246,6 @@ class UsernameHintsAPI(APIView):
|
||||
.filter(username__icontains=query) \
|
||||
.filter(asset__in=assets) \
|
||||
.values('username') \
|
||||
.annotate(total=Count('username')) \
|
||||
.annotate(total=Count('username', distinct=True)) \
|
||||
.order_by('total', '-username')[:10]
|
||||
return Response(data=top_accounts)
|
||||
|
Reference in New Issue
Block a user