修改部分导出报表问题

master
yulingwei 5 years ago
parent c8f072f983
commit 6ea4c72416

@ -1365,16 +1365,16 @@ function get_promote_levels($id = 0)
$data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find(); $data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find();
switch ($data['level']) { switch ($data['level']) {
case '1': case '1':
return "一级推广员"; return "会长";
break; break;
case '2': case '2':
return "二级推广员"; return "部门长";
break; break;
case '3': case '3':
return "三级推广员"; return "组长";
break; break;
case '4': case '4':
return "四级推广员"; return "员";
break; break;
default: default:

@ -67,10 +67,24 @@ class ExportController extends Controller
$map['server_id'] = trim($_REQUEST['server_id']); $map['server_id'] = trim($_REQUEST['server_id']);
unset($_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'])) { if (isset($_REQUEST['role_name'])) {
$map['role_name'] = array('like','%'.trim($_REQUEST['role_name']).'%'); $map['role_name'] = array('like','%'.trim($_REQUEST['role_name']).'%');
unset($_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_') $xlsData = M('user_play_info', 'tab_')
->where($map) ->where($map)
->order('id desc') ->order('id desc')
@ -171,7 +185,6 @@ class ExportController extends Controller
} }
break; break;
case 3: case 3:
if($_REQUEST['type']==2){ if($_REQUEST['type']==2){
$xlsCell = array( $xlsCell = array(
array('id', L('Account_number_ID')), array('id', L('Account_number_ID')),
@ -212,10 +225,34 @@ class ExportController extends Controller
} }
if (isset($_REQUEST['promote_account'])) { if (isset($_REQUEST['device_number'])) {
$map['promote_id'] = get_promote_id(trim(I('promote_account'))); $map['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['promote_account']); 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 (isset($_REQUEST['register_way'])) {
if($_REQUEST['type']==1) { if($_REQUEST['type']==1) {
if ($_GET['register_way'] == 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') $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_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('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) ->where($map)
->group('tab_user.id') ->group('tab_user.id')
->order($order) ->order($order)
@ -640,7 +679,7 @@ class ExportController extends Controller
} }
$map1 = $map; $map1 = $map;
$map1['pay_status'] = 1; $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) { if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0); $total = sprintf("%.2f", 0);
} else { } else {
@ -3101,6 +3140,18 @@ if ($key == 'model'){
} }
if (isset($_REQUEST['game_id'])) { if (isset($_REQUEST['game_id'])) {
$map['game_id'] = $_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'])) { if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); $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['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%');
} }
$map['login_time'] = array('neq', 0);
$page = intval($_REQUEST['p']); $page = intval($_REQUEST['p']);
$page = $page?$page:1; $page = $page?$page:1;
@ -4203,11 +4256,16 @@ if ($key == 'model'){
if($_REQUEST['game_name']=='全部'){ if($_REQUEST['game_name']=='全部'){
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
}else{ }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']); unset($_REQUEST['game_name']);
} }
} }
if(isset($_REQUEST['server_name'])){
$map['server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
$model = M('Server','tab_'); $model = M('Server','tab_');
if($_REQUEST['type']==2) { if($_REQUEST['type']==2) {

@ -39,6 +39,10 @@ class ServerController extends ThinkController {
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
} }
} }
if(isset($_REQUEST['server_name'])){
$extend['server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
if(empty($_GET['type']) || $_GET['type'] == 1) { if(empty($_GET['type']) || $_GET['type'] == 1) {
$extend['developers'] = array('EQ',0); $extend['developers'] = array('EQ',0);
}else{ }else{

@ -580,6 +580,10 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){
} }
} }
if (isset($_REQUEST['game_type'])) {
$map['sdk_version'] = trim($_REQUEST['game_type']);
unset($_REQUEST['game_type']);
}
empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"];
$list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc'); $list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc');
$this->assign('list', $list); $this->assign('list', $list);

@ -85,6 +85,11 @@
</volist> --> </volist> -->
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list" > <div class="input-list" >
<input type="text" id="time-start" name="timestart" class="" value="{:I('timestart')}" placeholder="开服开始时间" /> <input type="text" id="time-start" name="timestart" class="" value="{:I('timestart')}" placeholder="开服开始时间" />
- -
@ -326,7 +331,24 @@ $(function(){
}); });
$("#server_version").change(); $("#server_version").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#server_version option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
}) })
</script> </script>
</block> </block>

@ -154,6 +154,9 @@
'game_name'=>I('game_name'), 'game_name'=>I('game_name'),
'server_id'=>I('server_id'), 'server_id'=>I('server_id'),
'role_name'=>I('role_name'), 'role_name'=>I('role_name'),
'promote_level'=>I('promote_level'),
'promote_id'=>I('promote_id'),
'game_type'=>I('game_type'),
'xlsname'=>'玩家_角色查询', 'xlsname'=>'玩家_角色查询',
))}">导出</a> ))}">导出</a>
{$_page} {$_page}

@ -716,16 +716,16 @@ function get_promote_levels($id = 0)
$data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find(); $data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find();
switch ($data['level']) { switch ($data['level']) {
case '1': case '1':
return "一级推广员"; return "会长";
break; break;
case '2': case '2':
return "二级推广员"; return "部门长";
break; break;
case '3': case '3':
return "三级推广员"; return "组长";
break; break;
case '4': case '4':
return "四级推广员"; return "员";
break; break;
default: default:

Loading…
Cancel
Save