fix(server): 考勤趋势横坐标日期改为 YYYY-MM-DD 字符串返回
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user