From 77946bbb842f9ddc41434e3d101ed2b3998df1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=8B=A5?= Date: Sun, 8 Mar 2026 15:41:05 +0800 Subject: [PATCH] =?UTF-8?q?sync:=20soul-api=20=E6=8E=A5=E5=8F=A3=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20|=20=E5=8E=9F=E5=9B=A0:=20=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soul-api/internal/handler/match_records.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soul-api/internal/handler/match_records.go b/soul-api/internal/handler/match_records.go index 098dfd00..edc2212f 100644 --- a/soul-api/internal/handler/match_records.go +++ b/soul-api/internal/handler/match_records.go @@ -17,9 +17,9 @@ func DBMatchRecordsList(c *gin.Context) { if c.Query("stats") == "true" { var totalMatches int64 - db.Model(&model.MatchRecord{}).Count(&totalMatches) + db.Raw("SELECT COUNT(*) FROM match_records").Scan(&totalMatches) var todayMatches int64 - db.Model(&model.MatchRecord{}).Where("created_at >= CURDATE()").Count(&todayMatches) + db.Raw("SELECT COUNT(*) FROM match_records WHERE created_at >= CURDATE()").Scan(&todayMatches) type TypeCount struct { MatchType string `json:"matchType" gorm:"column:match_type"` Count int64 `json:"count" gorm:"column:count"`