sync: soul-api 接口逻辑 | 原因: 后端接口逻辑修改
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user