|
|
|
@ -145,7 +145,7 @@ class QueryController extends BaseController
|
|
|
|
|
$promoteData = [];
|
|
|
|
|
if (!empty($promoteIdData)) {
|
|
|
|
|
$promoteIdData = array_unique($promoteIdData);
|
|
|
|
|
$promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name');
|
|
|
|
|
$promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name,group_remark');
|
|
|
|
|
}
|
|
|
|
|
foreach ($data as &$list) {
|
|
|
|
|
switch ($list['level']) {
|
|
|
|
@ -168,8 +168,10 @@ class QueryController extends BaseController
|
|
|
|
|
$chainArr = explode('/', $chain);
|
|
|
|
|
$list['p_p_pro_account'] = $promoteData[$chainArr[1]]['account'];
|
|
|
|
|
$list['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name'];
|
|
|
|
|
$list['p_p_pro_group_remark'] = $promoteData[$chainArr[1]]['group_remark'];
|
|
|
|
|
$list['p_pro_account'] = $promoteData[$list['parent_id']]['account'];
|
|
|
|
|
$list['p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name'];
|
|
|
|
|
$list['p_pro_group_remark'] = $promoteData[$list['parent_id']]['group_remark'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8);
|
|
|
|
@ -1859,7 +1861,7 @@ class QueryController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$map['s.pay_time'] = ['between', [$begTime, $endTime - 1]];
|
|
|
|
|
$fieldS = "sum(s.pay_amount) recharge_cost, count(*) recharge_count, s.user_id, s.user_account, s.promote_account, s.game_name, s.sdk_version, s.server_name, SUBSTRING_INDEX(GROUP_CONCAT(s.game_player_name order by s.id desc), ',', 1) as game_player_name";
|
|
|
|
|
$fieldS = "sum(s.pay_amount) recharge_cost, count(*) recharge_count, s.user_id, s.user_account, s.promote_id, s.promote_account, s.game_name, s.sdk_version, s.server_name, SUBSTRING_INDEX(GROUP_CONCAT(s.game_player_name order by s.id desc), ',', 1) as game_player_name";
|
|
|
|
|
$fieldUser = 'u.register_time, u.login_time';
|
|
|
|
|
|
|
|
|
|
$spendMap['_string'] = 'today.user_id = s.user_id and today.game_id = s.game_id and today.server_id = s.server_id and today.game_player_id = s.game_player_id and today.promote_id = s.promote_id';
|
|
|
|
@ -1902,6 +1904,10 @@ class QueryController extends BaseController
|
|
|
|
|
$total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' : $total['recharge_cost_today'];
|
|
|
|
|
|
|
|
|
|
if (!empty($records)) {
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
$promoteIds = array_column($records, 'promote_id');
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select();
|
|
|
|
|
$promotes = index_by_column('id', $promotes);
|
|
|
|
|
foreach ($records as &$list) {
|
|
|
|
|
$list['user_account'] = empty($list['user_account']) ? '--' : encryption($list['user_account']);
|
|
|
|
|
$list['game_name'] = empty($list['game_name']) ? '--' : $list['game_name'];
|
|
|
|
@ -1912,6 +1918,7 @@ class QueryController extends BaseController
|
|
|
|
|
$list['login_time'] = empty($list['login_time']) ? '--' : date('Y-m-d H:i:s', $list['login_time']);
|
|
|
|
|
$list['register_time'] = empty($list['register_time']) ? '--' : date('Y-m-d H:i:s', $list['register_time']);
|
|
|
|
|
$list['promote_account'] = empty($list['promote_account']) ? '--' : $list['promote_account'];
|
|
|
|
|
$list['promote_group'] = isset($promotes[$list['promote_id']]) ? $promoteService->getGroupNameByChain($promotes[$list['promote_id']]['chain'], $list['promote_id']) : '';
|
|
|
|
|
$list['recharge_cost_today'] = empty($list['recharge_cost_today']) ? '0.00' : $list['recharge_cost_today'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1968,7 +1975,7 @@ class QueryController extends BaseController
|
|
|
|
|
public function getSubPromotes()
|
|
|
|
|
{
|
|
|
|
|
$promoteId = I('promote_id', 0) ?: -1;
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select();
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $promoteId])->select();
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
|
'status' => 1,
|
|
|
|
|
'msg' => '成功',
|
|
|
|
@ -2055,15 +2062,16 @@ class QueryController extends BaseController
|
|
|
|
|
|
|
|
|
|
$games = get_promote_serach_game();
|
|
|
|
|
|
|
|
|
|
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
|
|
|
|
|
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $parent['id']])->select();
|
|
|
|
|
|
|
|
|
|
$map = ['parent_id' => $parent['id']];
|
|
|
|
|
if ($promoteId > 0) {
|
|
|
|
|
$map['id'] = $promoteId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map);
|
|
|
|
|
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level', 'chain'])->where($map);
|
|
|
|
|
list($promotes, $pagination, $count) = $this->paginate($query);
|
|
|
|
|
|
|
|
|
|
$ids = array_column($promotes, 'id');
|
|
|
|
|
|
|
|
|
|
$rows = [];
|
|
|
|
@ -2121,6 +2129,8 @@ class QueryController extends BaseController
|
|
|
|
|
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promoteService = new PromoteService();
|
|
|
|
|
|
|
|
|
|
if (I('p', 1) == 1) {
|
|
|
|
|
$selfParams = $params;
|
|
|
|
|
$selfParams['isContainSubs'] = false;
|
|
|
|
@ -2133,7 +2143,8 @@ class QueryController 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']],
|
|
|
|
@ -2161,7 +2172,8 @@ class QueryController 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],
|
|
|
|
|