|
@@ -41,21 +41,32 @@ class GameStatis extends BaseController
|
|
|
|
|
|
|
|
// 获取游戏信息信息
|
|
// 获取游戏信息信息
|
|
|
$game_ids = array_unique(array_column($result['list'], 'game_id'));
|
|
$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 = [];
|
|
$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) {
|
|
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['game_profit'] = CommonUtils::convertBalance($item['game_profit'], false);
|
|
|
$item['bet_amount'] = CommonUtils::convertBalance($item['bet_amount'], false);
|
|
$item['bet_amount'] = CommonUtils::convertBalance($item['bet_amount'], false);
|
|
|
$item['commission_amount'] = CommonUtils::convertBalance($item['game_profit'] * 0.08, false);
|
|
$item['commission_amount'] = CommonUtils::convertBalance($item['game_profit'] * 0.08, false);
|
|
|
$item['platform_fee'] = CommonUtils::convertBalance($item['bet_amount'] * 0.08, false);
|
|
$item['platform_fee'] = CommonUtils::convertBalance($item['bet_amount'] * 0.08, false);
|
|
|
$item['buy_free_bet'] = 0;
|
|
$item['buy_free_bet'] = 0;
|
|
|
- $item['game_title'] = $gameList[$item['game_id']]['title'] ?? '';
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return json_success($result, '获取成功');
|
|
return json_success($result, '获取成功');
|