perf: 优化列表查询排序

This commit is contained in:
insistence
2024-10-22 16:28:08 +08:00
parent c7af974d3f
commit 53cc6eb8ce
6 changed files with 7 additions and 1 deletions

View File

@@ -72,6 +72,7 @@ class NoticeDao:
if query_object.begin_time and query_object.end_time
else True,
)
.order_by(SysNotice.notice_id)
.distinct()
)
notice_list = await PageUtil.paginate(db, query, query_object.page_num, query_object.page_size, is_page)