diff --git a/polls/views/__pycache__/group.cpython-38.pyc b/polls/views/__pycache__/group.cpython-38.pyc index abf3e42..4be74ed 100644 Binary files a/polls/views/__pycache__/group.cpython-38.pyc and b/polls/views/__pycache__/group.cpython-38.pyc differ diff --git a/polls/views/group.py b/polls/views/group.py index 0bd4bdd..1c4c8d6 100644 --- a/polls/views/group.py +++ b/polls/views/group.py @@ -74,7 +74,7 @@ def group_manager(request): group_id = request.GET.get('group_id') if not group_id: return JsonResponse({'status': 'error', 'message': '参数错误'}) - managers = Userprofile.objects.filter(user__group_admin__group_id=group_id) + managers = Userprofile.objects.filter(user__group_admin__group_id=group_id).order_by('user__group_admin__created') results = [] for m in managers: result = dict() @@ -82,6 +82,7 @@ def group_manager(request): result['name'] = m.name result['thumbnail'] = request.build_absolute_uri( m.image.url) if m.image else None + result['phone'] = m.user.username result['organization'] = m.organization.name results.append(result) return JsonResponse({'status': 'success', 'message': results}, safe=False) @@ -103,6 +104,7 @@ def group_member(request): result['name'] = m.name result['thumbnail'] = request.build_absolute_uri( m.image.url) if m.image else None + result['phone'] = m.user.username result['organization'] = m.organization.name results.append(result) return JsonResponse({'status': 'success', 'message': results}, safe=False)