@ -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
@ -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')
@ -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')
->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