充值玩家下载增加游戏累计登陆天数

master
sunke 5 years ago
parent 050ecd3bc4
commit d426395607

@ -3115,6 +3115,8 @@ class DownloadController extends BaseController {
'充值次数',
'昨日充值',
'未登录天数',
'玩家游戏累计登陆天数',
'注册时间',
'最后登录时间',
'推广员账号',
@ -3172,8 +3174,14 @@ class DownloadController extends BaseController {
//$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
$fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today";
$fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version";
$field = $fieldUC . ',' . $fieldUI;
$fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version,ui.create_time";
$loginRecordMap['lr.create_time'] = $map['uc.create_time'];
$loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id';
$fieldLR = M('login_daily_record', 'tab_')->alias('lr')
->field("count(*) as count")
->where($loginRecordMap)
->buildSql();
$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count';
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
@ -3227,6 +3235,8 @@ class DownloadController extends BaseController {
$csvData['recharge_count'] = empty($value['recharge_count']) ? 0 : $value['recharge_count'];
$csvData['recharge_cost_today'] = empty($value['recharge_cost_today']) ? 0 : $value['recharge_cost_today'];
$csvData['unlogin_day'] = empty($value['play_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $value['play_time']))) / (24 * 3600));
$csvData['user_game_login_count'] = empty($value['user_game_login_count']) ? 0 : $value['user_game_login_count'];
$csvData['create_time'] = empty($value['create_time']) ? '--' : date('Y-m-d H:i:s', $value['create_time']);
$csvData['play_time'] = empty($value['play_time']) ? '--' :date('Y-m-d H:i:s',$value['play_time']);
$csvData['promote_account'] = empty($value['promote_account']) ? '--' :$value['promote_account'];
@ -3248,6 +3258,8 @@ class DownloadController extends BaseController {
$allData['recharge_count'] = $total['recharge_count'];
$allData['recharge_cost_today'] = $total['recharge_cost_today'];
$allData['unlogin_day'] = '--';
$allData['user_game_login_count'] = '--';
$allData['create_time'] = '--';
$allData['play_time'] = '--';
$allData['promote_account'] = '--';
mb_convert_variables('GBK', 'UTF-8', $allData);

Loading…
Cancel
Save