diff --git a/api/views/statistic.py b/api/views/statistic.py index 2347eb9..8622b11 100644 --- a/api/views/statistic.py +++ b/api/views/statistic.py @@ -195,7 +195,8 @@ def get(self, request, round_id: int): d["score_list"].append(0) d["total_score"] = total_score data.append(d) - + # 取得前三名資料 + data = sorted(data, key=lambda x: x["total_score"], reverse=True)[:3] return Response(data, status=status.HTTP_200_OK) except Round.DoesNotExist: return Response(