|
|
|
@ -673,12 +673,21 @@ class QueryController extends BaseController
|
|
|
|
|
$sdkVersion = I('sdk_version', 0);
|
|
|
|
|
$gameId = I('game_id', 0);
|
|
|
|
|
$serverId = I('server_id', 0);
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
$subPromoteId = I('sub_promote_id', 0);
|
|
|
|
|
$promote = $this->getLoginPromote();
|
|
|
|
|
$searchPromote = $promote;
|
|
|
|
|
if ($promoteId > 0) {
|
|
|
|
|
$searchPromote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
|
|
|
|
|
}
|
|
|
|
|
if ($subPromoteId > 0) {
|
|
|
|
|
$searchPromote = M('promote', 'tab_')->where(['id' => $subPromoteId])->find();
|
|
|
|
|
}
|
|
|
|
|
$map = [
|
|
|
|
|
'_logic' => 'or',
|
|
|
|
|
'id' => $promote['id'],
|
|
|
|
|
'parent_id' => $promote['id'],
|
|
|
|
|
'grand_id' => $promote['id'],
|
|
|
|
|
'id' => $searchPromote['id'],
|
|
|
|
|
'parent_id' => $searchPromote['id'],
|
|
|
|
|
'grand_id' => $searchPromote['id'],
|
|
|
|
|
];
|
|
|
|
|
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
|
|
|
|
|
|
|
|
|
@ -747,6 +756,7 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('records', $records);
|
|
|
|
|
$this->assign('searchGameName', $searchGameName);
|
|
|
|
|
$this->assign('searchServerName', $searchServerName);
|
|
|
|
|
$this->assign('searchPromote', $searchPromote);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1900,6 +1910,8 @@ class QueryController extends BaseController
|
|
|
|
|
$userAccount = I('user_account', '');
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
$sdkVersion = I('sdk_version', 0);
|
|
|
|
|
$costBegin = I('cost_begin', 0);
|
|
|
|
|
$costEnd = I('cost_end', 0);
|
|
|
|
|
$headmanPromoteId = I('headman_promote_id', 0);
|
|
|
|
|
|
|
|
|
|
$promote = $this->getLoginPromote();
|
|
|
|
@ -1953,6 +1965,21 @@ class QueryController extends BaseController
|
|
|
|
|
$spendMap['promote_id'] = $promoteId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($costBegin > 0 || $costEnd > 0) {
|
|
|
|
|
$having = '';
|
|
|
|
|
if ($costBegin > 0 && $costEnd > 0) {
|
|
|
|
|
$having = 'sum(cost) between ' . $costBegin . ' and ' . $costEnd;
|
|
|
|
|
} elseif ($costBegin > 0 && $costEnd == 0) {
|
|
|
|
|
$having = 'sum(cost) > ' . $costBegin;
|
|
|
|
|
} elseif ($costBegin == 0 && $costEnd > 0) {
|
|
|
|
|
$having = 'sum(cost) < ' . $costEnd;
|
|
|
|
|
}
|
|
|
|
|
$subMap = $map;
|
|
|
|
|
$subMap['pay_status'] = 1;
|
|
|
|
|
$subMap['pay_game_status'] = 1;
|
|
|
|
|
$subQuery = M('spend', 'tab_')->field('game_player_id')->where($subMap)->group('game_player_id')->having($having)->buildSql();
|
|
|
|
|
$map['_string'] = 'role_id in ('. $subQuery . ')';
|
|
|
|
|
}
|
|
|
|
|
$query = M('user_play_info', 'tab_')->where($map);
|
|
|
|
|
list($roles, $pagination, $count) = $this->paginate($query);
|
|
|
|
|
$roleIds = array_column($roles, 'role_id');
|
|
|
|
@ -1971,6 +1998,9 @@ class QueryController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$map['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
|
|
|
|
|
if (isset($map['_string'])) {
|
|
|
|
|
unset($map['_string']);
|
|
|
|
|
}
|
|
|
|
|
$todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($map)->group('game_player_id')->select();
|
|
|
|
|
$todayRecords = [];
|
|
|
|
|
foreach ($todayRecharges as $recharge) {
|
|
|
|
@ -2049,7 +2079,7 @@ class QueryController extends BaseController
|
|
|
|
|
public function getSubPromotes()
|
|
|
|
|
{
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['parent_id' => $promoteId])->select();
|
|
|
|
|
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select();
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
|
'status' => 1,
|
|
|
|
|
'msg' => '成功',
|
|
|
|
@ -2108,14 +2138,18 @@ class QueryController extends BaseController
|
|
|
|
|
$serverId = I('server_id', 0);
|
|
|
|
|
$parentId = I('parent_id', 0);
|
|
|
|
|
$promoteId = I('promote_id', 0);
|
|
|
|
|
$status = I('status', 0);
|
|
|
|
|
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
|
|
|
|
|
$promote = null;
|
|
|
|
|
$searchPromoteType = 0;
|
|
|
|
|
if ($parentId > 0) {
|
|
|
|
|
$promote = M('promote', 'tab_')->where(['id' => $parentId])->find();
|
|
|
|
|
$searchPromoteType = 2;
|
|
|
|
|
} else {
|
|
|
|
|
$promote = $loginPromote;
|
|
|
|
|
$searchPromoteType = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$games = $this->getGamesByPromote($promote);
|
|
|
|
@ -2153,6 +2187,9 @@ class QueryController extends BaseController
|
|
|
|
|
if ($sdkVersion > 0) {
|
|
|
|
|
$params['sdk_version'] = $sdkVersion;
|
|
|
|
|
}
|
|
|
|
|
if ($status > 0) {
|
|
|
|
|
$params['lock_status'] = $status;
|
|
|
|
|
}
|
|
|
|
|
list($beginTime, $endTime) = $this->getBetweenTime($time);
|
|
|
|
|
$params['begin_time'] = $beginTime;
|
|
|
|
|
$params['end_time'] = $endTime;
|
|
|
|
@ -2160,17 +2197,48 @@ class QueryController extends BaseController
|
|
|
|
|
$promoteRepository = new PromoteRepository();
|
|
|
|
|
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
|
|
|
|
|
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);
|
|
|
|
|
|
|
|
|
|
$newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params);
|
|
|
|
|
$newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params);
|
|
|
|
|
$newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params);
|
|
|
|
|
|
|
|
|
|
$loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params);
|
|
|
|
|
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
|
|
|
|
|
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
|
|
|
|
|
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
|
|
|
|
|
|
|
|
|
|
$records = [];
|
|
|
|
|
if (I('p', 1) == 1) {
|
|
|
|
|
$selfParams = $params;
|
|
|
|
|
$selfParams['isContainSubs'] = false;
|
|
|
|
|
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$promote['id']], $selfParams);
|
|
|
|
|
$selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$promote['id']], $selfParams);
|
|
|
|
|
|
|
|
|
|
$records[] = [
|
|
|
|
|
'id' => $promote['id'],
|
|
|
|
|
'account' => $promote['account'],
|
|
|
|
|
'real_name' => $promote['real_name'],
|
|
|
|
|
'create_role_count' => $selfCreateRoleCountList[$promote['id']],
|
|
|
|
|
'create_role_user_count' => $selfCreateRoleUserCountList[$promote['id']],
|
|
|
|
|
'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$promote['id']],
|
|
|
|
|
'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$promote['id']],
|
|
|
|
|
'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$promote['id']],
|
|
|
|
|
'login_user_count' => $selfLoginUserCountList[$promote['id']],
|
|
|
|
|
'recharge_count' => $selfRechargeCountList[$promote['id']],
|
|
|
|
|
'recharge_user_count' => $selfRechargeUserCountList[$promote['id']],
|
|
|
|
|
'recharge_amount' => $selfRechargeAmountList[$promote['id']]['ban_coin'] + $rechargeAmountList[$promote['id']]['coin'] + $rechargeAmountList[$promote['id']]['cash'],
|
|
|
|
|
'recharge_by_ban_coin' => $selfRechargeAmountList[$promote['id']]['ban_coin'],
|
|
|
|
|
'recharge_by_coin' => $selfRechargeAmountList[$promote['id']]['coin'],
|
|
|
|
|
'recharge_by_cash' => $selfRechargeAmountList[$promote['id']]['cash'],
|
|
|
|
|
'search_promote_type' => $searchPromoteType,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach ($promotes as $promote) {
|
|
|
|
|
$id = $promote['id'];
|
|
|
|
|
$records[] = [
|
|
|
|
@ -2189,6 +2257,7 @@ class QueryController extends BaseController
|
|
|
|
|
'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'],
|
|
|
|
|
'recharge_by_coin' => $rechargeAmountList[$id]['coin'],
|
|
|
|
|
'recharge_by_cash' => $rechargeAmountList[$id]['cash'],
|
|
|
|
|
'search_promote_type' => 0,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|