doge 3 недель назад
Родитель
Сommit
eb92aefe58
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      app/Services/ThirdGameBalanceService.php

+ 10 - 2
app/Services/ThirdGameBalanceService.php

@@ -216,9 +216,17 @@ class ThirdGameBalanceService
     {
         $gameBalance = array_sum(array_filter($balances, 'is_numeric'));
         $walletBalances = [];
+        $gameBalances = [];
         foreach ($balances as $platform => $balance) {
             if (is_numeric($balance)) {
-                $walletBalances[$platform] = round((float) $balance / $this->rate(), 2);
+                $walletBalances[] = [
+                    'platform' => (string) $platform,
+                    'balance' => round((float) $balance / $this->rate(), 2),
+                ];
+                $gameBalances[] = [
+                    'platform' => (string) $platform,
+                    'balance' => round((float) $balance, 2),
+                ];
             }
         }
         return [
@@ -228,7 +236,7 @@ class ThirdGameBalanceService
             'currency' => (string) config('third_game.currency', 'CNY'),
             'rate' => $this->rate(),
             'list' => $walletBalances,
-            'game_list' => $balances,
+            'game_list' => $gameBalances,
             'total_game_balance' => round($gameBalance, 2),
             'total_balance' => $this->totalFromBalances($balances),
         ];