From e9c8f00ce85879ef6bdd66d0b0837a7c578f2108 Mon Sep 17 00:00:00 2001 From: GuoQing Zhang Date: Fri, 28 Jun 2024 15:23:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=88=86=E7=BB=84=E7=9A=84=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/bisheng/database/models/group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/bisheng/database/models/group.py b/src/backend/bisheng/database/models/group.py index 259a42deb..926628ef2 100644 --- a/src/backend/bisheng/database/models/group.py +++ b/src/backend/bisheng/database/models/group.py @@ -63,7 +63,7 @@ def insert_group(cls, group: GroupCreate) -> Group: @classmethod def get_all_group(cls) -> list[Group]: with session_getter() as session: - statement = select(Group).order_by(Group.id.desc()) + statement = select(Group).order_by(Group.update_time.desc()) return session.exec(statement).all() @classmethod @@ -71,7 +71,7 @@ def get_group_by_ids(cls, ids: List[int]) -> list[Group]: if not ids: raise ValueError('ids is empty') with session_getter() as session: - statement = select(Group).where(Group.id.in_(ids)).order_by(Group.id.desc()) + statement = select(Group).where(Group.id.in_(ids)).order_by(Group.update_time.desc()) return session.exec(statement).all() @classmethod