diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index 8db3fc557..44cb0b5c3 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -77,6 +77,8 @@ class AjaxController extends ThinkController{ $game_map = []; if ($game_name) { $game_map['relation_game_name'] = $game_name; + }else { + $this->AjaxReturn([]); } if ($sdk_version) { $map['server_version'] = $game_map['sdk_version'] = $sdk_version; diff --git a/Application/Admin/Controller/BehaviorLogController.class.php b/Application/Admin/Controller/BehaviorLogController.class.php index ec5612d45..f7673445a 100644 --- a/Application/Admin/Controller/BehaviorLogController.class.php +++ b/Application/Admin/Controller/BehaviorLogController.class.php @@ -9,34 +9,27 @@ class BehaviorLogController extends ThinkController { $params = I('get.'); - $ignoreData = ['p', 'row', 'timestart', 'timeend', 'promote_id']; $map = []; - // if (isset($params['user_account'])) { - // $map['user_account'] = $params['user_account']; - // } - // if (isset($params['extend'])) { - // $map['extend'] = $params['extend']; - // } - // if (isset($params['game_name'])) { - // $map['game_name'] = $params['game_name']; - // } - // if (isset($params['server_name'])) { - // $map['server_name'] = $params['server_name']; - // } - // if (isset($params['sdk_version'])) { - // $map['sdk_version'] = $params['sdk_version']; - // } - // if (isset($params['user_nickname'])) { - // $map['user_nickname'] = $params['user_nickname']; - // } - // if (isset($params['game_player_id'])) { - // $map['game_player_id'] = $params['game_player_id']; - // } - foreach ($params as $k => $v) { - if (!in_array($k, $ignoreData)) { - $map[$k] = $v; - } + if (isset($params['user_account'])) { + $map['user_account'] = $params['user_account']; + } + if (isset($params['extend'])) { + $map['extend'] = $params['extend']; + } + if (isset($params['game_name'])) { + $game_id = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; + $map['game_id'] = $game_id; + } + if (isset($params['server_name'])) { + $map['server_name'] = $params['server_name']; } + if (isset($params['user_nickname'])) { + $map['user_nickname'] = $params['user_nickname']; + } + if (isset($params['game_player_id'])) { + $map['game_player_id'] = $params['game_player_id']; + } + $p = $params['p'] ? $params['p'] : 1; $row = $params['row'] ? $params['row'] : 10; @@ -52,10 +45,8 @@ class BehaviorLogController extends ThinkController } else { $promoteMap['chain'] = ['like', "%/$promoteId/%"]; $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); - if(empty($promoteIds)) { - $promoteIds[] = $promoteIds; - } - $map['promote_id'] = ['in', $promoteIds]; + $promoteIds[] = $promoteId; + $map['promote_id'] = ['in', $promoteIds]; } } $data = M('pay_info', 'tab_')->where($map)->order('id DESC')->page($p, $row)->select(); diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index cead4d9ab..d4a64749a 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1802,6 +1802,62 @@ class ExportController extends Controller $xlsData[$key]['developers'] = get_developers_account($value['developers'],'account'); } break; + case 21: + $xlsCell = array( + array('extend', 'CP订单号'), + array('create_time', '充值时间'), + array('user_account', '玩家账号'), + array('game_name', '游戏名称'), + array('server_name', '游戏区服'), + array('promote_account', '所属推广员'), + array('game_player_id', '角色ID'), + array('game_player_name', '角色名称'), + array('price', '订单金额'), + ); + $params = I('get.'); + + $map = []; + if (isset($params['user_account'])) { + $map['user_account'] = $params['user_account']; + } + if (isset($params['extend'])) { + $map['extend'] = $params['extend']; + } + if (isset($params['game_name'])) { + $game_id = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; + $map['game_id'] = $game_id; + } + if (isset($params['server_name'])) { + $map['server_name'] = $params['server_name']; + } + if (isset($params['user_nickname'])) { + $map['user_nickname'] = $params['user_nickname']; + } + if (isset($params['game_player_id'])) { + $map['game_player_id'] = $params['game_player_id']; + } + + $startDate = empty($params['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $params['timestart']; + $endDate = empty($params['timeend']) ? date('Y-m-d') : $params['timeend']; + $startTime = strtotime($startDate); + $endTime = strtotime($endDate) + 86399; + $map['create_time'] = array('BETWEEN', [$startTime, $endTime]); + if ($promoteId = I('promote_id')) { + if ($promoteId == 0) { + $map['promote_id'] = 0; + } else { + $promoteMap['chain'] = ['like', "%/$promoteId/%"]; + $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $map['promote_id'] = ['in', $promoteIds]; + } + } + $xlsData = M('pay_info', 'tab_')->where($map)->order('id DESC')->select(); + foreach($xlsData as $k => $v) { + $xlsData[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']); + } + break; + default: $xlsName = $xlsCell = $xlsData = []; diff --git a/Application/Admin/View/BehaviorLog/index.html b/Application/Admin/View/BehaviorLog/index.html index 446c5a642..97b53ae2f 100644 --- a/Application/Admin/View/BehaviorLog/index.html +++ b/Application/Admin/View/BehaviorLog/index.html @@ -169,7 +169,7 @@