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

This commit is contained in:
卡若
2026-03-08 16:40:13 +08:00
parent 99536bdfe8
commit 413e373001

View File

@@ -104,6 +104,13 @@ func AdminDashboardOverview(c *gin.Context) {
})
}
// 匹配统计
var totalMatches int64
db.Raw("SELECT COUNT(*) FROM match_records").Scan(&totalMatches)
var matchRevenue float64
db.Model(&model.Order{}).Where("product_type = ? AND status IN ?", "match", []string{"paid", "completed", "success"}).
Select("COALESCE(SUM(amount),0)").Scan(&matchRevenue)
c.JSON(http.StatusOK, gin.H{
"success": true,
"totalUsers": totalUsers,
@@ -113,6 +120,8 @@ func AdminDashboardOverview(c *gin.Context) {
"conversionRate": conversionRate,
"recentOrders": recentOut,
"newUsers": newUsersOut,
"totalMatches": totalMatches,
"matchRevenue": matchRevenue,
})
}