Skip to content

Commit

Permalink
fix: 角色列表按照创建时间倒序 (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 28, 2024
2 parents 3ff8027 + 078098b commit f8b190a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/bisheng/database/models/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get_role_by_groups(cls, group: List[int], keyword: str = None, page: int = 0
statement = statement.filter(Role.role_name.like(f'%{keyword}%'))
if page and limit:
statement = statement.offset((page - 1) * limit).limit(limit)
statement = statement.order_by(Role.create_time.desc())
with session_getter() as session:
return session.exec(statement).all()

Expand Down

0 comments on commit f8b190a

Please sign in to comment.