feat: 调整enstat和mpointstat排序

This commit is contained in:
caoqianming 2024-12-06 18:23:44 +08:00
parent 6da1b14e7b
commit 2f35b78604
1 changed files with 2 additions and 2 deletions

View File

@ -161,7 +161,7 @@ class MpointStatViewSet(BulkCreateModelMixin, BulkDestroyModelMixin, CustomListM
select_related_fields = ["mpoint", "mpoint__ep_monitored", "mpoint__ep_belong", "mgroup", "mgroup__belong_dept"]
filterset_class = MpointStatFilter
ordering_fields = ['mpoint__report_sortstr', 'year', 'month', 'day', 'hour', 'year_s', 'month_s', 'day_s', 'mgroup__sort', 'create_time', "update_time"]
ordering = ["mpoint__report_sortstr", "-year", "-month", "-day", "-hour", "-year_s", "-month_s", "-day_s", "mgroup__sort"]
ordering = ["mpoint__report_sortstr", "-year", "-month", "-day", "-year_s", "-month_s", "-day_s", "-create_time", "mgroup__sort"]
def perform_create(self, serializer):
ins = serializer.save()
@ -239,7 +239,7 @@ class EnStatViewSet(CustomListModelMixin, CustomGenericViewSet):
serializer_class = EnStatSerializer
select_related_fields = ["mgroup", "team", "mgroup__belong_dept"]
filterset_class = EnStatFilter
ordering = ["mgroup__sort", "year", "month", "day", "hour", "year_s", "month_s", "day_s"]
ordering = ["mgroup__sort", "year_s", "month_s", "day_s", "create_time"]
ordering_fields = ["mgroup__sort", "year_s", "month_s", "day_s", "hour", "update_time", "create_time"]
@action(methods=["post"], detail=False, perms_map={"post": "*"}, serializer_class=EnStatAnaSerializer)