master
yulingwei 4 years ago
parent 574ade1b91
commit 7b9bb91e16

@ -3153,7 +3153,7 @@ class ExportController extends Controller
private function game_statistics_export($p = 1){
$xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:"游戏注册统计";
$xlsCell = array(
array('fgame_name', "游戏名称"),
array('relation_game_name', "游戏名称"),
array('count', "累计注册"),
array('rand', "排行榜"),
array('today', "今日注册"),
@ -3181,9 +3181,9 @@ class ExportController extends Controller
$map['register_time'] =array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
unset($_REQUEST['start']);unset($_REQUEST['end']);
}
if(isset($_REQUEST['game_name'])&&$_REQUEST['game_name']!=''){
$map['fgame_name'] =$_REQUEST['game_name'];
unset($_REQUEST['fgame_name']);
if(isset($_REQUEST['game_id'])&&$_REQUEST['game_id']!=''){
$map['tab_game.relation_game_id'] =$_REQUEST['game_id'];
unset($_REQUEST['game_id']);
}
$today = total(1);
$week = total(2);
@ -3191,9 +3191,10 @@ class ExportController extends Controller
//为数据权限添加
setPowerPromoteIds($map);
$data = $user
->field('fgame_name,fgame_id,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(id) as count')
->field('tab_game.relation_game_id,tab_game.relation_game_name,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count')
->join('tab_game on tab_game.id = fgame_id', 'left')
->where($map)
->group('fgame_id')
->group('tab_game.relation_game_id')
->order('count desc,register_time')
->select();
// dd($data);
@ -3205,8 +3206,9 @@ class ExportController extends Controller
$data2 = $user->field('fgame_id,count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join('tab_game on tab_game.id = fgame_id', 'left')
->where($map2)
->group('fgame_id')
->group('tab_game.relation_game_id')
->select();
$data2 = array_column($data2, null, 'fgame_id');
// dd($data2);
@ -3216,8 +3218,8 @@ class ExportController extends Controller
$i++;
$data[$key]['rand'] = $i;
if ($data[$key]['fgame_id'] == 0) {
$data[$key]['fgame_name'] = '其他注册';
if ($data[$key]['relation_game_id'] == 0) {
$data[$key]['relation_game_name'] = '其他注册';
}
$data[$key]['today'] = $data2[$value['fgame_id']]['today'];
$data[$key]['week'] = $data2[$value['fgame_id']]['week'];
@ -3237,7 +3239,7 @@ class ExportController extends Controller
// $data = array_slice($data, ($arraypage-1)*$size, $size);
$length = count($data);
$data[$length] = array(
'fgame_name'=>'汇总',
'relation_game_name'=>'汇总',
'count'=>$total['sum_count'],
'rand'=>'---',
'today'=>$total['sum_today'],
@ -3249,7 +3251,6 @@ class ExportController extends Controller
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏注册统计','url'=>U('Platform/game_statistics',$GetData),'menu'=>'统计-统计-平台统计-游戏注册统计']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3283,28 +3284,30 @@ class ExportController extends Controller
$map['game_id'] =$_REQUEST['game_name'];
unset($_REQUEST['game_name']);
}
$map['pay_status'] = 1;
$map['tab_spend.pay_status'] = 1;
$today = total(1);
$week = total(2);
$mounth = total(3);
$data = $spend
->field('game_name,game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->where($map)
->group('game_id')
->group('tab_game.relation_game_id')
->order('count desc,pay_time')
->select();
//今日、本周、本月不随搜索条件而变动
$map2['pay_status'] = 1;
$map2['tab_spend.pay_status'] = 1;
$map2['game_id'] = array('gt', 0);
setPowerPromoteIds($map2);
$data2 = $spend
->field('game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
->field('tab_game.relation_game_id as game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->where($map2)
->group('game_id')
->group('tab_game.relation_game_id')
->select();
$data2 = array_column($data2, null, 'game_id');
$count = count($data);

@ -40,9 +40,9 @@ class PlatformController extends ThinkController
}
// var_dump($_REQUEST);exit;
if (isset($_REQUEST['game_name']) && $_REQUEST['game_name'] != '') {
$map['fgame_name'] = $_REQUEST['game_name'];
unset($_REQUEST['fgame_name']);
if (isset($_REQUEST['game_id']) && $_REQUEST['game_id'] != '') {
$map['tab_game.relation_game_id'] = $_REQUEST['game_id'];
unset($_REQUEST['game_id']);
}
$today = total(1);
@ -51,9 +51,10 @@ class PlatformController extends ThinkController
//为数据权限添加
setPowerPromoteIds($map);
$data = $user
->field('fgame_name,fgame_id,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(id) as count')
->field('tab_game.relation_game_id,tab_game.relation_game_name,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count')
->where($map)
->group('fgame_id')
->join('tab_game on tab_game.id = fgame_id', 'left')
->group('tab_game.relation_game_id')
->order('count desc,register_time')
->select();
$map2 = array();
@ -61,25 +62,26 @@ class PlatformController extends ThinkController
$map2['puid'] = 0;
setPowerPromoteIds($map2);
$data2 = $user->field('fgame_id,count(IF(register_time ' . $today . ',1,null)) as today,
$data2 = $user->field('tab_game.relation_game_id,count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where($map2)
->group('fgame_id')
->join('tab_game on tab_game.id = fgame_id', 'left')
->group('tab_game.relation_game_id')
->select();
$data2 = array_column($data2, null, 'fgame_id');
$data2 = array_column($data2, null, 'relation_game_id');
$count = count($data);
foreach ($data as $key => $value) {
static $i = 0;
$i++;
$data[$key]['rand'] = $i;
if ($data[$key]['fgame_id'] == 0) {
$data[$key]['fgame_name'] = '其他注册';
if ($data[$key]['relation_game_id'] == 0) {
$data[$key]['relation_game_name'] = '其他注册';
}
$data[$key]['today'] = $data2[$value['fgame_id']]['today'];
$data[$key]['week'] = $data2[$value['fgame_id']]['week'];
$data[$key]['mounth'] = $data2[$value['fgame_id']]['mounth'];
$data[$key]['today'] = $data2[$value['relation_game_id']]['today'];
$data[$key]['week'] = $data2[$value['relation_game_id']]['week'];
$data[$key]['mounth'] = $data2[$value['relation_game_id']]['mounth'];
}
$total = $this->data_total($data);
@ -103,9 +105,10 @@ class PlatformController extends ThinkController
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->checkListOrCountAuthRestMap($map,[]);
//dd($data);
$this->meta_title = '游戏注册统计列表';
$this->assign('list_data', $data);
$this->assign('games', M('game', 'tab_')->field('relation_game_id, relation_game_name')->group('relation_game_id')->select());
$this->assign("is_admin",is_administrator());
$this->display();
}
@ -142,32 +145,34 @@ class PlatformController extends ThinkController
$map['game_id'] = array('gt', 0);
// var_dump($_REQUEST);exit;
if (isset($_REQUEST['game_name']) && $_REQUEST['game_name'] != '') {
$map['game_id'] = $_REQUEST['game_name'];
unset($_REQUEST['game_name']);
if (isset($_REQUEST['game_id']) && $_REQUEST['game_id'] != '') {
$map['tab_game.relation_game_id'] = $_REQUEST['game_id'];
unset($_REQUEST['game_id']);
}
$map['pay_status'] = 1;
$map['tab_spend.pay_status'] = 1;
$today = total(1);
$week = total(2);
$mounth = total(3);
$data = $spend
->field('game_name,game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->where($map)
->group('game_id')
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->group('tab_game.relation_game_id')
->order('count desc,pay_time')
->select();
//今日、本周、本月不随搜索条件而变动
$map2['pay_status'] = 1;
$map2['tab_spend.pay_status'] = 1;
$map2['game_id'] = array('gt', 0);
setPowerPromoteIds($map2);
$data2 = $spend
->field('game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
->field('tab_game.relation_game_id as game_id, sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->where($map2)
->group('game_id')
->group('tab_game.relation_game_id')
->select();
$data2 = array_column($data2, null, 'game_id');
$count = count($data);
@ -205,6 +210,7 @@ class PlatformController extends ThinkController
$this->meta_title = '游戏充值统计列表';
$this->assign('list_data', $data);
$this->assign("is_admin",is_administrator());
$this->assign('games', M('game', 'tab_')->field('relation_game_id, relation_game_name')->group('relation_game_id')->select());
$this->display();
}

@ -58,10 +58,10 @@
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" >
<select id="game_id" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
<volist name="games" id="vo">
<option game-id="{$vo.relation_game_id}" value="{$vo.relation_game_id}">{$vo.relation_game_name}</option>
</volist>
</select>
</div>
@ -139,7 +139,7 @@
<else />
<volist name="list_data" id="data">
<tr>
<td ><if condition="$data.rand eq 1"><span >{$data.fgame_name}</span><elseif condition="$data.rand eq 2"/><span>{$data.fgame_name}</span><elseif condition="$data.rand eq 3"/><span>{$data.fgame_name}</span><else/>{$data.fgame_name}</if></td>
<td ><if condition="$data.rand eq 1"><span >{$data.relation_game_name}</span><elseif condition="$data.rand eq 2"/><span>{$data.relation_game_name}</span><elseif condition="$data.rand eq 3"/><span>{$data.relation_game_name}</span><else/>{$data.relation_game_name}</if></td>
<td ><span>{$data.count}</span></td>
<td ><strong><if condition="$data.rand eq 1"><span >{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
@ -166,7 +166,7 @@
array(
'timestart'=>$_GET['timestart'],
'timeend'=>$_GET['timeend'],
'game_name'=>$_GET['game_name'],
'game_id'=>$_GET['game_id'],
'p'=>$_GET['p'],
'xlsname'=>'统计_平台统计_游戏注册统计',
),

@ -56,10 +56,10 @@
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery">
<select id="game_id" name="game_id" class="select_gallery">
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
<volist name="games" id="vo">
<option game-id="{$vo.relation_game_id}" value="{$vo.relation_game_id}">{$vo.relation_game_name}</option>
</volist>
</select>
</div>
@ -136,7 +136,7 @@
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn" href="{:U('Export/platform_statistics',
array('timestart'=>$_GET['timestart'],'timeend'=>$_GET['timeend'],'type'=>1,'game_name'=>$_GET['game_name'],p=>$_GET['p'],'xlsname'=>'统计_平台统计_游戏充值统计',)
array('timestart'=>$_GET['timestart'],'timeend'=>$_GET['timeend'],'type'=>1,'game_id'=>$_GET['game_id'],p=>$_GET['p'],'xlsname'=>'统计_平台统计_游戏充值统计',)
,false)}">导出</a>
</if>
{$_page|default=''}

Loading…
Cancel
Save