@ -2456,8 +2468,8 @@ class ExportController extends Controller
setPowerPromoteIds($map2);
setPowerPromoteIds($map2);
$data2 = $user->field('fgame_id,count(IF(register_time ' . $today . ',1,null)) as today,
$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 ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where($map2)
->where($map2)
->group('fgame_id')
->group('fgame_id')
->select();
->select();
@ -2548,8 +2560,8 @@ class ExportController extends Controller
setPowerPromoteIds($map2);
setPowerPromoteIds($map2);
$data2 = $spend
$data2 = $spend
->field('game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
->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 ' . $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')
->where($map2)
->where($map2)
->group('game_id')
->group('game_id')
->select();
->select();
@ -2642,8 +2654,8 @@ class ExportController extends Controller
$data2 = $user
$data2 = $user
->field('register_way,
->field('register_way,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where($map2)
->where($map2)
->group('register_way')
->group('register_way')
->select();
->select();
@ -2729,9 +2741,9 @@ class ExportController extends Controller
setPowerPromoteIds($map2);
setPowerPromoteIds($map2);
$data2 = $spend
$data2 = $spend
->field('pay_way,
->field('pay_way,
sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
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')
->where($map2)
->where($map2)
->group('pay_way')
->group('pay_way')
->select();
->select();
@ -2848,7 +2860,7 @@ class ExportController extends Controller
}
}
//为数据权限添加
//为数据权限添加
setPowerPromoteIds($map, 'u.promote_id');
setPowerPromoteIds($map, 'u.promote_id');
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
@ -2868,7 +2880,7 @@ class ExportController extends Controller
//官方渠道数据添加
//官方渠道数据添加
$authorityData = M('user', 'tab_')->alias('u')
$authorityData = M('user', 'tab_')->alias('u')
->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time,
->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time,
count(id) as count,
count(id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
@ -3440,9 +3452,9 @@ class ExportController extends Controller
array('mau','MAU'),
array('mau','MAU'),
);
);
if (is_file(RUNTIME_PATH.'/access_data_user.txt')) {
if (is_file(RUNTIME_PATH.'/access_data_user.txt')) {
@ -3233,15 +3233,20 @@ class DownloadController extends BaseController {
// ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
// ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')