sync: soul-api 接口逻辑 | 原因: 后端接口逻辑修改
This commit is contained in:
@@ -17,9 +17,9 @@ func DBMatchRecordsList(c *gin.Context) {
|
|||||||
|
|
||||||
if c.Query("stats") == "true" {
|
if c.Query("stats") == "true" {
|
||||||
var totalMatches int64
|
var totalMatches int64
|
||||||
db.Model(&model.MatchRecord{}).Count(&totalMatches)
|
db.Raw("SELECT COUNT(*) FROM match_records").Scan(&totalMatches)
|
||||||
var todayMatches int64
|
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 {
|
type TypeCount struct {
|
||||||
MatchType string `json:"matchType" gorm:"column:match_type"`
|
MatchType string `json:"matchType" gorm:"column:match_type"`
|
||||||
Count int64 `json:"count" gorm:"column:count"`
|
Count int64 `json:"count" gorm:"column:count"`
|
||||||
|
|||||||
Reference in New Issue
Block a user