|
|
|
@ -1474,7 +1474,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
if ($promoteId > 0) {
|
|
|
|
|
$map['id'] = $promoteId;
|
|
|
|
|
}
|
|
|
|
|
$data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map)->select();
|
|
|
|
|
$data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level', 'chain'])->where($map)->select();
|
|
|
|
|
$ids = array_column($data, 'id');
|
|
|
|
|
$rows = [];
|
|
|
|
|
if (count($ids) > 0) {
|
|
|
|
@ -3043,11 +3043,12 @@ class DownloadController extends BaseController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function achievementExcelInfo($tid,$map) {
|
|
|
|
|
public function achievementExcelInfo($tid, $map) {
|
|
|
|
|
$xlsName = "推广员业绩";
|
|
|
|
|
$xlsCell = array(
|
|
|
|
|
array('account','账号'),
|
|
|
|
|
array('real_name','姓名'),
|
|
|
|
|
array('promote_group', '部门/小组'),
|
|
|
|
|
array('create_role_count','创角数'),
|
|
|
|
|
array('create_role_user_count','创角用户'),
|
|
|
|
|
array('new_create_role_user_count','新创角用户'),
|
|
|
|
@ -3106,7 +3107,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
|
|
|
|
|
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
$records = [];
|
|
|
|
|
if (I('p', 1) == 1) {
|
|
|
|
|
$selfParams = $params;
|
|
|
|
@ -3120,7 +3121,8 @@ class DownloadController extends BaseController {
|
|
|
|
|
$record = [
|
|
|
|
|
'id' => $parent['id'],
|
|
|
|
|
'account' => $parent['account'],
|
|
|
|
|
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
|
|
|
|
|
'promote_group' => $promoteService->getGroupNameByChain($parent['chain'], $parent['id']),
|
|
|
|
|
'real_name' => hideRealName($parent['real_name']),
|
|
|
|
|
'level' => $parent['level'],
|
|
|
|
|
'create_role_count' => $selfCreateRoleCountList[$parent['id']],
|
|
|
|
|
'create_role_user_count' => $selfCreateRoleUserCountList[$parent['id']],
|
|
|
|
@ -3148,7 +3150,8 @@ class DownloadController extends BaseController {
|
|
|
|
|
$record = [
|
|
|
|
|
'id' => $id,
|
|
|
|
|
'account' => $promote['account'],
|
|
|
|
|
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
|
|
|
|
|
'promote_group' => $promoteService->getGroupNameByChain($promote['chain'], $promote['id']),
|
|
|
|
|
'real_name' => hideRealName($promote['real_name']),
|
|
|
|
|
'level' => $promote['level'],
|
|
|
|
|
'create_role_count' => $createRoleCountList[$id],
|
|
|
|
|
'create_role_user_count' => $createRoleUserCountList[$id],
|
|
|
|
@ -3248,7 +3251,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
unset($map['begintime']);
|
|
|
|
|
unset($map['endtime']);
|
|
|
|
|
$map['uc.pay_status'] = 1;
|
|
|
|
|
$fieldS = "sum(uc.pay_amount) recharge_cost, count(*) recharge_count, uc.user_id, uc.user_account, uc.promote_account, uc.game_name, uc.sdk_version, uc.server_name, SUBSTRING_INDEX(GROUP_CONCAT(uc.game_player_name order by uc.id desc), ',', 1) as game_player_name";
|
|
|
|
|
$fieldS = "sum(uc.pay_amount) recharge_cost, count(*) recharge_count, uc.user_id, uc.user_account, uc.promote_id, uc.promote_account, uc.game_name, uc.sdk_version, uc.server_name, SUBSTRING_INDEX(GROUP_CONCAT(uc.game_player_name order by uc.id desc), ',', 1) as game_player_name";
|
|
|
|
|
$fieldUser = 'u.register_time, u.login_time';
|
|
|
|
|
|
|
|
|
|
$now = date('Y-m-d');
|
|
|
|
@ -3312,6 +3315,12 @@ class DownloadController extends BaseController {
|
|
|
|
|
->table($subQuery)
|
|
|
|
|
->limit(($i-1)*$perSize ,$perSize)
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
$promoteIds = array_column($data, 'promote_id');
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select();
|
|
|
|
|
$promotes = index_by_column('id', $promotes);
|
|
|
|
|
|
|
|
|
|
foreach($data as $key => $value) {
|
|
|
|
|
// if (empty($value['user_account']) ) {
|
|
|
|
|
// $value['user_account'] = $users[$value['user_id']] ?? '';
|
|
|
|
@ -3335,7 +3344,12 @@ class DownloadController extends BaseController {
|
|
|
|
|
$csvData['create_time'] = empty($value['register_time']) ? '--' : date('Y-m-d H:i:s', $value['register_time']);
|
|
|
|
|
$csvData['login_time'] = empty($value['login_time']) ? '--' :date('Y-m-d H:i:s',$value['login_time']);
|
|
|
|
|
$csvData['promote_account'] = empty($value['promote_account']) ? '--' :$value['promote_account'];
|
|
|
|
|
|
|
|
|
|
if (isset($promotes[$value['promote_id']])) {
|
|
|
|
|
$groupName = $promoteService->getGroupNameByChain($promotes[$value['promote_id']]['chain'], $value['promote_id']);
|
|
|
|
|
if ($groupName) {
|
|
|
|
|
$csvData['promote_account'] .= '(' . $groupName . ')';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mb_convert_variables('GBK', 'UTF-8', $csvData);
|
|
|
|
|
fputcsv($fp, $csvData);
|
|
|
|
|
$xlsData[] = $csvData;
|
|
|
|
|