sync: soul-api 接口逻辑 | 原因: 后端接口逻辑修改

This commit is contained in:
卡若
2026-03-08 15:41:05 +08:00
parent 37a80228ce
commit 77946bbb84

View File

@@ -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"`