fix(server): 考勤趋势横坐标日期改为 YYYY-MM-DD 字符串返回

This commit is contained in:
2026-08-12 10:12:04 +08:00
parent 7987941a3c
commit b0e66f81ad
@@ -43,7 +43,8 @@ async getAttendanceTrend(
const trendQb = attendanceRepo
.createQueryBuilder('a')
.select('a.attendanceDate', 'date')
// DATE_FORMAT 直接输出 YYYY-MM-DD 字符串,避免 mysql2 把 DATE 列序列化成 ISO 时间戳
.select("DATE_FORMAT(a.attendanceDate, '%Y-%m-%d')", 'date')
.addSelect('a.status', 'status')
.addSelect('COUNT(*)', 'count')
.where('a.attendanceDate >= :start', { start: startStr })