chore: update
This commit is contained in:
@@ -50,12 +50,15 @@ func GetMyCompletedOrders(c *gin.Context) {
|
||||
// ✅ Récupérer les infos client pour statistiques
|
||||
client, err := database.GetClientByUsername(usernameStr)
|
||||
|
||||
// ✅ Récupérer les noms des pools de points
|
||||
// ✅ Récupérer les noms et clés des pools de points
|
||||
poolNames := []string{"Pool 1", "Pool 2"}
|
||||
var poolKeys []string
|
||||
if settings, sErr := database.GetSettings(); sErr == nil && len(settings.PointsPools) > 0 {
|
||||
poolNames = make([]string, len(settings.PointsPools))
|
||||
poolKeys = make([]string, len(settings.PointsPools))
|
||||
for i, p := range settings.PointsPools {
|
||||
poolNames[i] = p.Name
|
||||
poolKeys[i] = p.Key
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,15 +69,17 @@ func GetMyCompletedOrders(c *gin.Context) {
|
||||
}
|
||||
|
||||
if err == nil && client != nil {
|
||||
// Construire le tableau générique des valeurs par pool
|
||||
poolPoints := make([]int, len(poolNames))
|
||||
if len(poolPoints) > 0 {
|
||||
poolPoints[0] = client.Point
|
||||
}
|
||||
if len(poolPoints) > 1 {
|
||||
poolPoints[1] = client.PointZipette
|
||||
// Construire le tableau depuis points_extra[poolKey] pour tous les pools (stockage dynamique)
|
||||
poolPoints := make([]int, len(poolKeys))
|
||||
for i, key := range poolKeys {
|
||||
if key != "" {
|
||||
poolPoints[i] = client.PointsExtra[key]
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("📊 [HISTORY] pool_names=%v pool_keys=%v pool_points=%v extra=%v",
|
||||
poolNames, poolKeys, poolPoints, client.PointsExtra)
|
||||
|
||||
response["client_stats"] = gin.H{
|
||||
"username": client.Username,
|
||||
"total_commands": client.Command,
|
||||
|
||||
Reference in New Issue
Block a user