Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
tpingzhang 5 years ago
commit ae958820b4

@ -958,7 +958,7 @@ class QueryController extends BaseController
$allData['spend_voucher'] = 0; $allData['spend_voucher'] = 0;
foreach ($data as &$list) { foreach ($data as &$list) {
$thisDateTime = strtotime($list['day']); $thisDateTime = strtotime($list['day']);
$userPlayInfoWhere['tab_user_play_info.play_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; $userPlayInfoWhere['tab_user_play_info.create_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]];
$userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; $userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]];
$spendWhere['tab_spend.pay_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]]; $spendWhere['tab_spend.pay_time'] = ['between', [$thisDateTime, $thisDateTime + 86399]];
@ -976,7 +976,7 @@ class QueryController extends BaseController
->group('tab_user_play_info.user_id') ->group('tab_user_play_info.user_id')
->select());//创角用户 ->select());//创角用户
$newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $thisDateTime . $newWhere . ') as old_num'; $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num';
$list['new_user_num'] = count($userPlayInfoModel $list['new_user_num'] = count($userPlayInfoModel
->field($newUserSql) ->field($newUserSql)
->join($join) ->join($join)
@ -985,15 +985,24 @@ class QueryController extends BaseController
->group('tab_user_play_info.user_id') ->group('tab_user_play_info.user_id')
->having('old_num = 0') ->having('old_num = 0')
->select());//新创角用户 ->select());//新创角用户
$list['new_device_num'] = 0;//新创角设备
$newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.play_ip = tab_user_play_info.play_ip and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $thisDateTime . $newWhere . ') as old_num'; $newDeviceSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_device_number = tab_user_play_info.create_device_number and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num';
$list['new_device_num'] = count($userPlayInfoModel
->field($newDeviceSql)
->join($join)
->where($userPlayInfoWhere)
->where($map)
->group('tab_user_play_info.create_device_number')
->having('old_num = 0')
->select());//新创角设备
$newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_ip = tab_user_play_info.create_ip and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $thisDateTime . $newWhere . ') as old_num';
$list['new_ip_num'] = count($userPlayInfoModel $list['new_ip_num'] = count($userPlayInfoModel
->field($newIpSql) ->field($newIpSql)
->join($join) ->join($join)
->where($userPlayInfoWhere) ->where($userPlayInfoWhere)
->where($map) ->where($map)
->group('tab_user_play_info.play_ip') ->group('tab_user_play_info.create_ip')
->having('old_num = 0') ->having('old_num = 0')
->fetchSql(true) ->fetchSql(true)
->select());//新增创角IP ->select());//新增创角IP
@ -1215,7 +1224,7 @@ class QueryController extends BaseController
$newWhere = ''; $newWhere = '';
$begTime = strtotime($initBegTime); $begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime); $endTime = strtotime($initEndTime);
$userPlayInfoWhere['tab_user_play_info.play_time'] = ['between', [$begTime, $endTime + 86399]]; $userPlayInfoWhere['tab_user_play_info.create_time'] = ['between', [$begTime, $endTime + 86399]];
$userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$begTime, $endTime + 86399]]; $userGameLoginWhere['tab_user_game_login_record.login_time'] = ['between', [$begTime, $endTime + 86399]];
$spendWhere['tab_spend.pay_time'] = ['between', [$begTime, $endTime + 86399]]; $spendWhere['tab_spend.pay_time'] = ['between', [$begTime, $endTime + 86399]];
$spendWhere['tab_spend.pay_status'] = 1; $spendWhere['tab_spend.pay_status'] = 1;
@ -1238,7 +1247,7 @@ class QueryController extends BaseController
->group('tab_user_play_info.user_id') ->group('tab_user_play_info.user_id')
->select());//创角用户 ->select());//创角用户
$newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $begTime . $newWhere . ') as old_num'; $newUserSql = '(select count(ti.id) from tab_user_play_info as ti where ti.user_id = tab_user_play_info.user_id and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num';
$list['new_user_num'] = count($userPlayInfoModel $list['new_user_num'] = count($userPlayInfoModel
->field($newUserSql) ->field($newUserSql)
->where($userPlayInfoWhere) ->where($userPlayInfoWhere)
@ -1246,13 +1255,19 @@ class QueryController extends BaseController
->having('old_num = 0') ->having('old_num = 0')
->select());//新创角用户 ->select());//新创角用户
$list['new_device_num'] = 0;//新创角设备 $newDeviceSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_device_number = tab_user_play_info.create_device_number and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num';
$list['new_device_num'] = count($userPlayInfoModel
->field($newDeviceSql)
->where($userPlayInfoWhere)
->group('tab_user_play_info.create_device_number')
->having('old_num = 0')
->select());//新创角设备
$newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.play_ip = tab_user_play_info.play_ip and ti.game_id = tab_user_play_info.game_id and ti.play_time < ' . $begTime . $newWhere . ') as old_num'; $newIpSql = '(select count(ti.id) from tab_user_play_info as ti where ti.create_ip = tab_user_play_info.create_ip and ti.game_id = tab_user_play_info.game_id and ti.create_time < ' . $begTime . $newWhere . ') as old_num';
$list['new_ip_num'] = count($userPlayInfoModel $list['new_ip_num'] = count($userPlayInfoModel
->field($newIpSql) ->field($newIpSql)
->where($userPlayInfoWhere) ->where($userPlayInfoWhere)
->group('tab_user_play_info.play_ip') ->group('tab_user_play_info.create_ip')
->having('old_num = 0') ->having('old_num = 0')
->fetchSql(true) ->fetchSql(true)
->select());//新增创角IP ->select());//新增创角IP

Loading…
Cancel
Save