fix(analytics): simplify GROUP BY and ORDER BY clauses in getDailyTrend function

This commit is contained in:
MythEclipse
2026-05-31 01:34:35 +07:00
parent 48b4123f58
commit ce945c8af0
+2 -2
View File
@@ -758,8 +758,8 @@ export async function getDailyTrend(input: {
AND created_at >= ? AND created_at >= ?
AND deleted_at IS NULL AND deleted_at IS NULL
${channelId ? `AND (channel_id = ? OR thread_id = ?)` : ""} ${channelId ? `AND (channel_id = ? OR thread_id = ?)` : ""}
GROUP BY date(created_at / 1000, 'unixepoch') GROUP BY 1
ORDER BY date ASC ORDER BY 1 ASC
`, `,
channelId ? [guildId, since, channelId, channelId] : [guildId, since], channelId ? [guildId, since, channelId, channelId] : [guildId, since],
); );