|
|
|
@ -67,10 +67,24 @@ class ExportController extends Controller
|
|
|
|
|
$map['server_id'] = trim($_REQUEST['server_id']);
|
|
|
|
|
unset($_REQUEST['server_id']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['game_type'])) {
|
|
|
|
|
$map['sdk_version'] = trim($_REQUEST['game_type']);
|
|
|
|
|
unset($_REQUEST['game_type']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['role_name'])) {
|
|
|
|
|
$map['role_name'] = array('like','%'.trim($_REQUEST['role_name']).'%');
|
|
|
|
|
unset($_REQUEST['role_name']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
|
$queryStr = '';
|
|
|
|
|
if ($_REQUEST['promote_id'] == 0) {
|
|
|
|
|
$map['promote_id'] = '0';
|
|
|
|
|
} else {
|
|
|
|
|
$queryStr = "chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}";
|
|
|
|
|
$promoter_ids = D("Promote")->where($queryStr)->field('id')->select();
|
|
|
|
|
$promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$xlsData = M('user_play_info', 'tab_')
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('id desc')
|
|
|
|
@ -171,7 +185,6 @@ class ExportController extends Controller
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
|
|
if($_REQUEST['type']==2){
|
|
|
|
|
$xlsCell = array(
|
|
|
|
|
array('id', L('Account_number_ID')),
|
|
|
|
@ -212,10 +225,34 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['promote_account'])) {
|
|
|
|
|
$map['promote_id'] = get_promote_id(trim(I('promote_account')));
|
|
|
|
|
unset($_REQUEST['promote_account']);
|
|
|
|
|
if (isset($_REQUEST['device_number'])) {
|
|
|
|
|
$map['tab_user.device_number'] = $_REQUEST['device_number'];
|
|
|
|
|
unset($_REQUEST['device_number']);
|
|
|
|
|
}
|
|
|
|
|
if ($_REQUEST['promote_id'] != '') {
|
|
|
|
|
if($_REQUEST['promote_id']=='UC'){
|
|
|
|
|
$map['tab_user.promote_account'] = 'UC用户';
|
|
|
|
|
} else if ($_REQUEST['promote_id']==0) {
|
|
|
|
|
$map['tab_user.promote_id'] = 0;
|
|
|
|
|
} else{
|
|
|
|
|
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
|
|
|
|
|
if ($promoter_ids) {
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$game_map = "";
|
|
|
|
|
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_play_map = '';
|
|
|
|
|
if (isset($_REQUEST['server_name'])) {
|
|
|
|
|
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
|
|
|
|
|
}
|
|
|
|
|
// if (isset($_REQUEST['promote_account'])) {
|
|
|
|
|
// $map['promote_id'] = get_promote_id(trim(I('promote_account')));
|
|
|
|
|
// unset($_REQUEST['promote_account']);
|
|
|
|
|
// }
|
|
|
|
|
if (isset($_REQUEST['register_way'])) {
|
|
|
|
|
if($_REQUEST['type']==1) {
|
|
|
|
|
if ($_GET['register_way'] == 1) {
|
|
|
|
@ -270,6 +307,8 @@ class ExportController extends Controller
|
|
|
|
|
$xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total')
|
|
|
|
|
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
|
|
|
|
|
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
|
|
|
|
|
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
|
|
|
|
|
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('tab_user.id')
|
|
|
|
|
->order($order)
|
|
|
|
@ -640,7 +679,7 @@ class ExportController extends Controller
|
|
|
|
|
}
|
|
|
|
|
$map1 = $map;
|
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
|
$total = D('Spend')->where($map1)->sum('pay_amount');
|
|
|
|
|
$total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount');
|
|
|
|
|
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
|
|
|
|
|
$total = sprintf("%.2f", 0);
|
|
|
|
|
} else {
|
|
|
|
@ -3101,6 +3140,18 @@ if ($key == 'model'){
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['game_id'])) {
|
|
|
|
|
$map['game_id'] = $_REQUEST['game_id'];
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['game_name'])) {
|
|
|
|
|
$map['game_name'] = ['like', $_REQUEST['game_name']."%"];
|
|
|
|
|
unset($_REQUEST['game_name']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['game_type'])) {
|
|
|
|
|
$map['sdk_version'] = $_REQUEST['game_type'];
|
|
|
|
|
unset($_REQUEST['game_type']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['server_name'])) {
|
|
|
|
|
$map['server_name'] = $_REQUEST['server_name'];
|
|
|
|
|
unset($_REQUEST['server_name']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
|
|
|
|
|
$map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1));
|
|
|
|
@ -3113,6 +3164,8 @@ if ($key == 'model'){
|
|
|
|
|
$map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$map['login_time'] = array('neq', 0);
|
|
|
|
|
|
|
|
|
|
$page = intval($_REQUEST['p']);
|
|
|
|
|
|
|
|
|
|
$page = $page?$page:1;
|
|
|
|
@ -4203,11 +4256,16 @@ if ($key == 'model'){
|
|
|
|
|
if($_REQUEST['game_name']=='全部'){
|
|
|
|
|
unset($_REQUEST['game_name']);
|
|
|
|
|
}else{
|
|
|
|
|
$extend['game_name']=['like', "{$_REQUEST['game_name']}%"];
|
|
|
|
|
$map['server_version']=$_REQUEST['server_version'];
|
|
|
|
|
$map['game_name']=['like', "{$_REQUEST['game_name']}%"];
|
|
|
|
|
unset($_REQUEST['game_name']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_REQUEST['server_name'])){
|
|
|
|
|
$map['server_name']=$_REQUEST['server_name'];
|
|
|
|
|
unset($_REQUEST['server_name']);
|
|
|
|
|
}
|
|
|
|
|
$model = M('Server','tab_');
|
|
|
|
|
|
|
|
|
|
if($_REQUEST['type']==2) {
|
|
|
|
|