|
|
|
@ -44,21 +44,32 @@ class PlatformController extends ThinkController
|
|
|
|
|
$map['fgame_name'] = $_REQUEST['game_name'];
|
|
|
|
|
unset($_REQUEST['fgame_name']);
|
|
|
|
|
}
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
|
|
|
|
|
$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')
|
|
|
|
|
->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();
|
|
|
|
|
// dd($data);
|
|
|
|
|
$map2 = array();
|
|
|
|
|
$map2['fgame_id'] = array('egt', 0);
|
|
|
|
|
$map2['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;
|
|
|
|
@ -68,6 +79,9 @@ class PlatformController extends ThinkController
|
|
|
|
|
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 = $this->data_total($data);
|
|
|
|
@ -110,8 +124,6 @@ class PlatformController extends ThinkController
|
|
|
|
|
|
|
|
|
|
$spend = M('Spend', 'tab_');
|
|
|
|
|
$deposit = M('Deposit', "tab_");
|
|
|
|
|
$map['game_id'] = array('gt', 0);
|
|
|
|
|
|
|
|
|
|
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
|
|
|
|
|
$map['pay_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
|
|
|
|
|
unset($_REQUEST['timestart']);
|
|
|
|
@ -132,24 +144,40 @@ class PlatformController extends ThinkController
|
|
|
|
|
$map['game_id'] = $_REQUEST['game_name'];
|
|
|
|
|
unset($_REQUEST['game_name']);
|
|
|
|
|
}
|
|
|
|
|
$map['game_id'] = array('gt', 0);
|
|
|
|
|
$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,
|
|
|
|
|
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')
|
|
|
|
|
->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,pay_time')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
//今日、本周、本月不随搜索条件而变动
|
|
|
|
|
$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;
|
|
|
|
|
$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 = $this->data_total($data);
|
|
|
|
|
$this->assign('total', $total);
|
|
|
|
@ -219,20 +247,34 @@ class PlatformController extends ThinkController
|
|
|
|
|
$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,
|
|
|
|
|
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')
|
|
|
|
|
->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,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();
|
|
|
|
|
$data2 = array_column($data2, null, 'register_way');
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$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 = $this->data_total($data);
|
|
|
|
|
if ($_REQUEST['data_order'] != '') {
|
|
|
|
|
$data_order = reset(explode(',', $_REQUEST['data_order']));
|
|
|
|
@ -302,20 +344,35 @@ class PlatformController extends ThinkController
|
|
|
|
|
$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,
|
|
|
|
|
->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,pay_time')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$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($map)
|
|
|
|
|
->where($map2)
|
|
|
|
|
->group('pay_way')
|
|
|
|
|
->order('count desc,pay_time')
|
|
|
|
|
->select();
|
|
|
|
|
$data2 = array_column($data2, null, 'pay_way');
|
|
|
|
|
|
|
|
|
|
$count = count($data);
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
static $i = 0;
|
|
|
|
|
$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 = $this->data_total($data);
|
|
|
|
|
$this->assign('total', $total);
|
|
|
|
|
if ($_REQUEST['data_order'] != '') {
|
|
|
|
@ -513,7 +570,7 @@ class PlatformController extends ThinkController
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$promote_map2 = array();
|
|
|
|
|
setPowerPromoteIds($promote_map2, 'id');
|
|
|
|
|
$promote = M("promote","tab_")->field("id,account")->where($promote_map)->where($promote_map2)->select();
|
|
|
|
|
$promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->where($promote_map2)->select();
|
|
|
|
|
$pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount'];
|
|
|
|
|
|
|
|
|
|
// var_dump( $promote);
|
|
|
|
@ -584,11 +641,10 @@ class PlatformController extends ThinkController
|
|
|
|
|
$this->assign('userarpu_order_type', $data_order_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
|
$page = set_pagination($pcount, $row);
|
|
|
|
|
if ($page) {
|
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
|
}
|
|
|
|
|
$data = array_slice($data, ($arraypage - 1) * $row, $row);
|
|
|
|
|
|
|
|
|
|
$data = my_sort($data, $data_order_type, (int)$data_order);
|
|
|
|
|
|
|
|
|
|