From e3783b167f132005c7afcc4c10f9ab167806331d Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 04 三月 2025 13:22:04 +0800
Subject: [PATCH] fix: 按天统计相关逻辑

---
 app/src/main/java/com/example/firstapp/model/DailyStat.kt |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/src/main/java/com/example/firstapp/model/DailyStat.kt b/app/src/main/java/com/example/firstapp/model/DailyStat.kt
index 5cd26c6..f916d6f 100644
--- a/app/src/main/java/com/example/firstapp/model/DailyStat.kt
+++ b/app/src/main/java/com/example/firstapp/model/DailyStat.kt
@@ -4,13 +4,14 @@
 
 @DatabaseView(
     """
-    SELECT date(createtime/1000, 'unixepoch', 'localtime') as date, 
+    SELECT substr(createtime, 1, 10) as date, 
            COUNT(*) as count 
     FROM code 
-    GROUP BY date(createtime/1000, 'unixepoch', 'localtime')
+    WHERE substr(createtime, 1, 10) = date('now')
+    GROUP BY substr(createtime, 1, 10)
     """
 )
 data class DailyStat(
     val date: String,
     val count: Int
-) 
\ No newline at end of file
+)
\ No newline at end of file

--
Gitblit v1.9.3