diff --git a/apps/hrm/views.py b/apps/hrm/views.py index 29624361..c21244d5 100755 --- a/apps/hrm/views.py +++ b/apps/hrm/views.py @@ -255,7 +255,8 @@ class AttendanceViewSet(CustomModelViewSet): 'user__belong_dept', 'user__post', 'shift', 'team'] filterset_fields = ['user', 'user__belong_dept', 'user__post', 'state', 'work_date', 'user__name', 'user__phone'] - ordering = ['-create_time'] + search_fields = ['user__name', 'user__phone'] + ordering = ['-work_date', '-create_time'] class ClockRecordViewSet(BulkCreateModelMixin, ListModelMixin, BulkDestroyModelMixin, CustomGenericViewSet):