|
|
|
@ -2438,30 +2438,43 @@ class ExportController extends Controller
|
|
|
|
|
$map['fgame_name'] =$_REQUEST['game_name'];
|
|
|
|
|
unset($_REQUEST['fgame_name']);
|
|
|
|
|
}
|
|
|
|
|
$today=total(1);
|
|
|
|
|
$week=total(2);
|
|
|
|
|
$mounth=total(3);
|
|
|
|
|
$today = total(1);
|
|
|
|
|
$week = total(2);
|
|
|
|
|
$mounth = total(3);
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$data=$user
|
|
|
|
|
->field('fgame_name,fgame_id,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(id) as count,
|
|
|
|
|
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')
|
|
|
|
|
$data = $user
|
|
|
|
|
->field('fgame_name,fgame_id,date_format(FROM_UNIXTIME( register_time),"%Y-%m-%d") AS time, count(id) as count')
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('fgame_id')
|
|
|
|
|
->order('count desc,register_time')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$count=count($data);
|
|
|
|
|
// dd($data);
|
|
|
|
|
$map2 = array();
|
|
|
|
|
$map['fgame_id'] = array('egt', 0);
|
|
|
|
|
$map['puid'] = 0;
|
|
|
|
|
setPowerPromoteIds($map2);
|
|
|
|
|
|
|
|
|
|
$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')
|
|
|
|
|
->where($map2)
|
|
|
|
|
->group('fgame_id')
|
|
|
|
|
->select();
|
|
|
|
|
$data2 = array_column($data2, null, 'fgame_id');
|
|
|
|
|
// dd($data2);
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i=0;
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$i++;
|
|
|
|
|
$data[$key]['rand']=$i;
|
|
|
|
|
$data[$key]['rand'] = $i;
|
|
|
|
|
|
|
|
|
|
if ($data[$key]['fgame_id'] == 0) {
|
|
|
|
|
$data[$key]['fgame_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'];
|
|
|
|
|
}
|
|
|
|
|
$total=A('Platform')->data_total($data);
|
|
|
|
|
if($_REQUEST['data_order']!=''){
|
|
|
|
@ -2517,26 +2530,39 @@ class ExportController extends Controller
|
|
|
|
|
$map['game_id'] =$_REQUEST['game_name'];
|
|
|
|
|
unset($_REQUEST['game_name']);
|
|
|
|
|
}
|
|
|
|
|
$map['pay_status']=1;
|
|
|
|
|
$today=total(1);
|
|
|
|
|
$week=total(2);
|
|
|
|
|
$mounth=total(3);
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$data=$spend
|
|
|
|
|
->field('game_name,game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count,
|
|
|
|
|
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')
|
|
|
|
|
$map['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)
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('game_id')
|
|
|
|
|
->order('count desc')
|
|
|
|
|
->order('count desc,pay_time')
|
|
|
|
|
->select();
|
|
|
|
|
$count=count($data);
|
|
|
|
|
//今日、本周、本月不随搜索条件而变动
|
|
|
|
|
$map2['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,
|
|
|
|
|
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
|
|
|
|
|
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
|
|
|
|
|
->where($map2)
|
|
|
|
|
->group('game_id')
|
|
|
|
|
->select();
|
|
|
|
|
$data2 = array_column($data2, null, 'game_id');
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i=0;
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$i++;
|
|
|
|
|
$data[$key]['rand']=$i;
|
|
|
|
|
$data[$key]['rand'] = $i;
|
|
|
|
|
//加入今日、本周、本月数据
|
|
|
|
|
$data[$key]['today'] = $data2[$value['game_id']]['today'];
|
|
|
|
|
$data[$key]['week'] = $data2[$value['game_id']]['week'];
|
|
|
|
|
$data[$key]['mounth'] = $data2[$value['game_id']]['mounth'];
|
|
|
|
|
}
|
|
|
|
|
$total=A('Platform')->data_total($data);
|
|
|
|
|
$this->assign('total',$total);
|
|
|
|
@ -2583,7 +2609,8 @@ class ExportController extends Controller
|
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
|
|
$arraypage=$page;
|
|
|
|
|
$row = 10;
|
|
|
|
|
$user=M('User','tab_');$map['puid'] = 0;
|
|
|
|
|
$user=M('User','tab_');
|
|
|
|
|
$map['puid'] = 0;
|
|
|
|
|
if(isset($_REQUEST['timestart'])&&isset($_REQUEST['timeend'])){
|
|
|
|
|
$map['register_time'] =array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1));
|
|
|
|
|
unset($_REQUEST['timestart']);unset($_REQUEST['timeend']);
|
|
|
|
@ -2596,26 +2623,41 @@ class ExportController extends Controller
|
|
|
|
|
$map['register_way'] =$_REQUEST['register_way'];
|
|
|
|
|
unset($_REQUEST['register_way']);
|
|
|
|
|
}
|
|
|
|
|
$today=total(1);
|
|
|
|
|
$week=total(2);
|
|
|
|
|
$mounth=total(3);
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$data=$user
|
|
|
|
|
->field('register_way,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count,
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
|
|
$today = total(1);
|
|
|
|
|
$week = total(2);
|
|
|
|
|
$mounth = total(3);
|
|
|
|
|
$data = $user
|
|
|
|
|
->field('register_way,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count')
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('register_way')
|
|
|
|
|
->order('count desc')
|
|
|
|
|
->order('count desc,register_time')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$map2 = array();
|
|
|
|
|
$map2['puid'] = 0;
|
|
|
|
|
setPowerPromoteIds($map2);
|
|
|
|
|
$data2 = $user
|
|
|
|
|
->field('register_way,
|
|
|
|
|
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('register_way')
|
|
|
|
|
->select();
|
|
|
|
|
$count=count($data);
|
|
|
|
|
$data2 = array_column($data2, null, 'register_way');
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i=0;
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$i++;
|
|
|
|
|
$data[$key]['rand']=$i;
|
|
|
|
|
$data[$key]['rand'] = $i;
|
|
|
|
|
$data[$key]['today'] = $data2[$value['register_way']]['today'];
|
|
|
|
|
$data[$key]['week'] = $data2[$value['register_way']]['week'];
|
|
|
|
|
$data[$key]['mounth'] = $data2[$value['register_way']]['mounth'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$total=A('Platform')->data_total($data);
|
|
|
|
|
if($_REQUEST['data_order']!=''){
|
|
|
|
|
$data_order=reset(explode(',',$_REQUEST['data_order']));
|
|
|
|
@ -2669,27 +2711,42 @@ class ExportController extends Controller
|
|
|
|
|
$map['pay_way'] = array('in',$_REQUEST['pay_way']) ;
|
|
|
|
|
unset($_REQUEST['pay_way']);
|
|
|
|
|
}
|
|
|
|
|
$map['pay_status']=1;
|
|
|
|
|
$today=total(1);
|
|
|
|
|
$week=total(2);
|
|
|
|
|
$mounth=total(3);
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$data=$spend
|
|
|
|
|
->field('pay_way,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count,
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
|
|
$map['pay_status'] = 1;
|
|
|
|
|
$today = total(1);
|
|
|
|
|
$week = total(2);
|
|
|
|
|
$mounth = total(3);
|
|
|
|
|
$data = $spend
|
|
|
|
|
->field('pay_way,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count')
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('pay_way')
|
|
|
|
|
->order('count desc')
|
|
|
|
|
->order('count desc,pay_time')
|
|
|
|
|
->select();
|
|
|
|
|
$count=count($data);
|
|
|
|
|
|
|
|
|
|
$map2 = array();
|
|
|
|
|
$map2['pay_status'] = 1;
|
|
|
|
|
setPowerPromoteIds($map2);
|
|
|
|
|
$data2 = $spend
|
|
|
|
|
->field('pay_way,
|
|
|
|
|
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')
|
|
|
|
|
->where($map2)
|
|
|
|
|
->group('pay_way')
|
|
|
|
|
->select();
|
|
|
|
|
$data2 = array_column($data2, null, 'pay_way');
|
|
|
|
|
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i=0;
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$i++;
|
|
|
|
|
$data[$key]['rand']=$i;
|
|
|
|
|
$data[$key]['rand'] = $i;
|
|
|
|
|
$data[$key]['today'] = $data2[$value['pay_way']]['today'];
|
|
|
|
|
$data[$key]['week'] = $data2[$value['pay_way']]['week'];
|
|
|
|
|
$data[$key]['mounth'] = $data2[$value['pay_way']]['mounth'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$total = A('Platform')->data_total($data);
|
|
|
|
|
$this->assign('total',$total);
|
|
|
|
|
if($_REQUEST['data_order']!=''){
|
|
|
|
|