fix(后台公告): 后台公告列表置顶的排在最前,和学生在首页看到的顺序一样

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-13 14:21:49 +08:00
1 parent 56071c71bd
commit b93d4d83a1
1 file changed
+2 -1
+2 -1
View File
@@ -60,7 +60,8 @@ adminAnnouncementRoutes.get("/announcements", requireSuperAdmin, async (c) => {
.from(schema.announcement)
.innerJoin(schema.user, eq(schema.announcement.createdById, schema.user.id))
.leftJoin(schema.userProfile, eq(schema.userProfile.userId, schema.user.id))
.orderBy(desc(schema.announcement.createTime))
// 置顶的在最前,和学生在首页看到的顺序一样
.orderBy(desc(schema.announcement.top), desc(schema.announcement.createTime))
.limit(limit)
.offset(offset),
])