- 详情 activities 排序改为按登记时间倒序,新增 reg_at 字段 - formatDateRange 同一天合并显示,字符数减半避免被截断 - DataTable 给活动名/时间/时长列显式宽度,时间列加 pl-3 留白防切
This commit is contained in:
@@ -76,11 +76,11 @@ router.get('/:id', (req: Request, res: Response) => {
|
||||
if (!raw) return res.status(404).json({ error: '部员不存在' });
|
||||
const user = enrichUser(raw);
|
||||
const activities = db.prepareCompat(`
|
||||
SELECT a.id, a.title, a.start_time, a.end_time, h.hours, h.remark
|
||||
SELECT a.id, a.title, a.start_time, a.end_time, h.hours, h.remark, h.created_at AS reg_at
|
||||
FROM hours h
|
||||
JOIN activities a ON h.activity_id = a.id
|
||||
WHERE h.user_id = ?
|
||||
ORDER BY a.start_time DESC
|
||||
ORDER BY h.created_at DESC, a.start_time DESC
|
||||
`).all(id);
|
||||
res.json({ ...user, activities });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user