fix: FluentQuery.filter 污染 base_qs 导致积分处罚列表为空

This commit is contained in:
XingQue
2026-06-25 16:28:45 +08:00
parent 8ee7814a45
commit a69c008f96
2 changed files with 15 additions and 13 deletions

View File

@@ -9059,7 +9059,6 @@ class KefuPunishmentListView(APIView):
'yichuli': base_qs.filter(ApplyStatus__in=[1, 2]).count(),
}
# 4. 构建查询条件
queryset = base_qs
if status_list and isinstance(status_list, list):
@@ -9072,9 +9071,9 @@ class KefuPunishmentListView(APIView):
queryset = queryset.filter(PlayerID=dashouid)
# 5. 分页
total = queryset.count()
offset = (page - 1) * page_size
records = queryset.order_by('-CreateTime')[offset:offset + page_size]
page_obj = queryset.order_by('-CreateTime').paginate(page=page, per_page=page_size)
total = page_obj.total
records = page_obj.items
# 6. 构建返回列表
list_data = []