From 9c8d14ba055d0a6c2ef19e66224f13611d47d14a Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Fri, 13 Jan 2023 14:40:12 +0800 Subject: [PATCH] =?UTF-8?q?changes=20=E8=AF=84=E7=BA=A7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=80=92=E5=8F=99=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Crud/RatingFlowParticipantCrud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/Crud/RatingFlowParticipantCrud.py b/App/Crud/RatingFlowParticipantCrud.py index ab29ff9..3db1625 100644 --- a/App/Crud/RatingFlowParticipantCrud.py +++ b/App/Crud/RatingFlowParticipantCrud.py @@ -7,7 +7,7 @@ def list_users_rating_flows(db: Session, user_id, page, pagesize): page = 1 if page < 1 else (100 if page > 100 else page) pagesize = 5 if pagesize < 5 else (10 if pagesize > 10 else pagesize) - items = db.query(RatingFlowParticipant).filter_by(user_id=user_id).offset((page-1)*pagesize).limit(pagesize).all() + items = db.query(RatingFlowParticipant).order_by(RatingFlowParticipant.id.desc()).filter_by(user_id=user_id).offset((page-1)*pagesize).limit(pagesize).all() count = db.query(RatingFlowParticipant).filter_by(user_id=user_id).count() return items, count