diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 04f1f4440..34ffcab5b 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -214,13 +214,13 @@ class ExportController extends Controller // array('lock_status', L('Account_status'), 'get_info_status', '*', '4'), // ); $field = 'a.id,a.account,a.id as get_registertype,a.promote_account,a.balance,IFNULL(sum(ss.pay_amount),0) as recharge_total, - a.gold_coin,a.alipay,a.id as small_count,a.id as vip_level,a.register_type,a.register_time + a.gold_coin,a.alipay,a.id as small_count,a.id as vip_level,a.register_type ,a.register_ip,a.login_time,a.device_number,a.lock_status,check_status,a.age_status,a.register_way, a.register_type'; $xlsCell = [L('Account_number_ID'),"第三方来源","绑定账号",L('Subordinate_channel'), "账户平台币" , "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", L('Registration_time'), L('Register_iP'), "最后登录时间","设备号", L('Account_status'),"拉黑状态"]; - $map['tab_user.register_type']= ['in','3,4,5,6']; +// $map['tab_user.register_type']= ['in','3,4,5,6']; }else{ // $xlsCell = array( // array('id', L('Account_number_ID')), @@ -364,10 +364,20 @@ class ExportController extends Controller // if (isset($_REQUEST['game_name'])) { // //$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; // } + + $game_map = ""; + + $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + $spendprom = " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; if (isset($_REQUEST['server_name'])) { $map['server_name'] = ['like', "{$_REQUEST['server_name']}%"]; } + $game_play_map = ''; + if (isset($_REQUEST['server_name'])) { + $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; + } + if (isset($_REQUEST['viplevel'])) { @@ -409,7 +419,7 @@ class ExportController extends Controller // '序号ID', '姓名', '电话', // ]; - $fileName = '导出.xlsx'; +// $fileName = '导出.xlsx'; $csvFileName = $xlsName.'.csv'; //设置好告诉浏览器要下载excel文件的headers header('Content-Description: File Transfer'); @@ -454,6 +464,8 @@ class ExportController extends Controller if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){ $xlsData = $usermodel->table('(' . $sql1 . ') as a ')->field($field) ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1'.$spendprom) + ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false) ->limit(($i-1)*$perSize ,$perSize) ->having($havs) ->group('a.id') @@ -463,12 +475,15 @@ class ExportController extends Controller }else{ $xlsData = $usermodel->table('(' . $sql1 . ') as a ')->field($field) ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1') + ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false) ->limit(($i-1)*$perSize ,$perSize) ->having($havs) ->group('a.id') ->order($order) ->select(); } +// echo $usermodel->_sql();die(); //数据 @@ -489,7 +504,10 @@ class ExportController extends Controller if($_REQUEST['type']==2){ $xlsData[$k]['register_type'] = get_registertype($v['register_type']); } - $xlsData[$k]['register_time'] = date('Y-m-d H:i:s',$xlsData[$k]['register_time']); + if ($_REQUEST['type']!=2) { + $xlsData[$k]['register_time'] = date('Y-m-d H:i:s',$xlsData[$k]['register_time']); + } + $xlsData[$k]['login_time'] = date('Y-m-d H:i:s',$xlsData[$k]['login_time']); $xlsData[$k]['lock_status'] = $xlsData[$k]['lock_status']==1?'正常':'锁定'; $xlsData[$k]['check_status'] = $xlsData[$k]['check_status']==1?'正常':'已拉黑'; diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index d687cc151..30745ad83 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1253,7 +1253,7 @@ class DownloadController extends BaseController { } public function userRecharge_data_export() { - $gameId = I('game_id', 0); + $gameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $isSelf = I('is_self', 0); $roleName = I('role_name', ''); @@ -1310,7 +1310,12 @@ class DownloadController extends BaseController { } if ($gameId != 0) { - $map['game_id'] = $gameId; + $gameMap['relation_game_id'] = $gameId; + if ($sdkVersion != 0) { + $gameMap['sdk_version'] = $sdkVersion; + } + $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); + $map['game_id'] = ['in', $gameId1]; } if ($serverId != 0) { $map['server_id'] = $serverId; @@ -1371,7 +1376,7 @@ class DownloadController extends BaseController { public function achievement_data_export() { $time = I('time', date('Y-m-d')); $sdkVersion = I('sdk_version', 0); - $gameId = I('game_id', 0); + $gameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $parentId = I('parent_id', 0); $promoteId = I('promote_id', 0); @@ -1424,7 +1429,12 @@ class DownloadController extends BaseController { $map['currentDisplay'] = $currentDisplay; $map['ids'] = $ids; if ($gameId > 0) { - $params['game_id'] = $gameId; + $gameMap['relation_game_id'] = $gameId; + if ($sdkVersion > 0) { + $gameMap['sdk_version'] = $sdkVersion; + } + $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); + $params['game_id'] = ['in', $gameId1]; } if ($serverId > 0) { $params['server_id'] = $serverId; @@ -1461,7 +1471,7 @@ class DownloadController extends BaseController { } //玩家角色 public function userRoles_data_export() { - $gameId = I('game_id', 0); + $gameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $isSelf = I('is_self', 0); $roleName = I('role_name', ''); @@ -1517,7 +1527,12 @@ class DownloadController extends BaseController { if ($gameId != 0) { - $map['game_id'] = $gameId; + $gameMap['relation_game_id'] = $gameId; + if ($sdkVersion != 0) { + $gameMap['sdk_version'] = $sdkVersion; + } + $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); + $map['game_id'] = ['in', $gameId1]; } if ($serverId != 0) { $map['serverId'] = $serverId;