fix(bugcollect): 修复 trend 接口 500 — GROUP BY 兼容 MySQL only_full_group_by

SELECT e.createdAt 配合 GROUP BY DATE(e.createdAt) 在 MySQL strict mode
下触发 Expression #1 of SELECT list is not in GROUP BY clause 错误。
改为 MIN(e.createdAt) 作为聚合列,类型不变,LogService 无需修改。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
XuqmGroup 2026-06-24 18:51:17 +08:00
父节点 16dcd5ebac
当前提交 227425b80a

查看文件

@ -25,7 +25,7 @@ public interface LogIssueEventRepository extends JpaRepository<LogIssueEventEnti
Page<LogIssueEventEntity> findByAppKeyAndCreatedAtBetween(
String appKey, LocalDateTime from, LocalDateTime to, Pageable pageable);
@Query("SELECT e.createdAt, COUNT(e), COUNT(DISTINCT e.userId) FROM LogIssueEventEntity e " +
@Query("SELECT MIN(e.createdAt), COUNT(e), COUNT(DISTINCT e.userId) FROM LogIssueEventEntity e " +
"WHERE e.issueId = :issueId AND e.createdAt BETWEEN :from AND :to " +
"GROUP BY FUNCTION('DATE', e.createdAt) ORDER BY FUNCTION('DATE', e.createdAt)")
List<Object[]> findDailyCountsByIssueId(