ソースを参照

Merge remote-tracking branch 'origin/main'

ssvfdn 3 ヶ月 前
コミット
f2f8d75c58
2 ファイル変更17 行追加5 行削除
  1. 16 5
      app/controller/GameStatis.php
  2. 1 0
      app/controller/MerchantStatis.php

+ 16 - 5
app/controller/GameStatis.php

@@ -41,21 +41,32 @@ class GameStatis extends BaseController
 
             // 获取游戏信息信息
             $game_ids = array_unique(array_column($result['list'], 'game_id'));
-            $tempGameList = GameModel::where([['merchant_id', '=', $userInfo['merchant_id']], ['game_id', 'in', $game_ids]])->field(['game_id','title','image'])->select()->toArray();
+            $tempGameList = GameModel::where([['merchant_id', '=', $userInfo['merchant_id']], ['game_id', 'in', $game_ids]])
+                                        ->field(['game_id','title','image', 'game_platform'])
+                                        ->select()
+                                        ->toArray();
             $gameList = [];
-            foreach ($tempGameList as $item) {
-                $game_id = $item['game_id'];
-                $gameList[$game_id] = $item;
+            foreach ($tempGameList as $game) {
+                $game_id = $game['game_id'];
+                $gameList[$game_id] = $game;
             }            
             
             // 格式化数据
             foreach ($result['list'] as &$item) {
+                $game_id = $item['game_id'];
+                $gameInfo = $gameList[$game_id] ?? [];
+                if (!empty($gameInfo))
+                {
+                    $gameImages = CommonUtils::getGameDefaultImage($gameInfo);
+                }
+                $item['game_image_url'] = $gameImages['image_url'] ?? '';
+                $item['game_title'] = $gameInfo['title'] ?? '';
+                $item['game_type_text'] = CommonUtils::getGameTypeConfig($gameInfo['game_platform']);
                 $item['game_profit'] = CommonUtils::convertBalance($item['game_profit'], false);
                 $item['bet_amount'] = CommonUtils::convertBalance($item['bet_amount'], false);
                 $item['commission_amount'] = CommonUtils::convertBalance($item['game_profit'] * 0.08, false);
                 $item['platform_fee'] = CommonUtils::convertBalance($item['bet_amount'] * 0.08, false);
                 $item['buy_free_bet'] = 0;
-                $item['game_title'] = $gameList[$item['game_id']]['title'] ?? '';
             }
             
             return json_success($result, '获取成功');

+ 1 - 0
app/controller/MerchantStatis.php

@@ -71,6 +71,7 @@ class MerchantStatis extends BaseController
             $result = MerchantStatisModel::getMerchantHistory($userInfo['merchant_id'], $filters);
             
             // 格式化数据
+            $result['rtp'] = !is_null($result["rtp"]) ? $result["rtp"] : 0;
             $result['date_stage'] = implode(' ~ ', $filters);
             $result['game_profit'] = CommonUtils::convertBalance($result['game_profit'], false);
             $result['bet_amount'] = CommonUtils::convertBalance($result['bet_amount'], false);