@ -44,14 +44,21 @@ class QueryController extends BaseController
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
}
$teamLeaderId = I('team_leader_id');//组长账号
$teamLeaderId = intval( I('team_leader_id') );//组长账号
if (!empty($teamLeaderId)) {
if (!empty($teamLeaderId)) {
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
if ($hasTeamLeaderPermission === false) {
if ($hasTeamLeaderPermission === false) {
$this->error('组长权限异常');
$this->error('组长权限异常');
}
}
$map['tab_spend.promote_id'] = $teamLeaderId;
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
if (empty($childPromoteIds)) {
$map['tab_spend.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
}
}
$promoteId = I('promote_id');//推广员账号
$promoteId = I('promote_id');//推广员账号
@ -61,18 +68,10 @@ class QueryController extends BaseController
$this->error('推广员权限异常');
$this->error('推广员权限异常');
}
}
if (!empty($map['tab_spend.promote_id'])) {
$map['tab_spend.promote_id'] = $promoteId;
$map['_string'] = 'tab_spend.promote_id = ' . $promoteId;
} else {
$map['tab_spend.promote_id'] = $promoteId;
}
}
}
if (!empty(I('own_id'))) {
if (!empty(I('own_id'))) {
if (!empty($map['_string'])) {
unset($map['_string']);
}
$map['tab_spend.promote_id'] = I('own_id');//本账号
$map['tab_spend.promote_id'] = I('own_id');//本账号
}
}
@ -146,6 +145,7 @@ class QueryController extends BaseController
empty(I('own_id')) || $parameter['own_id'] = I('own_id');
empty(I('own_id')) || $parameter['own_id'] = I('own_id');
empty(I('begtime')) || $parameter['begtime'] = I('begtime');
empty(I('begtime')) || $parameter['begtime'] = I('begtime');
empty(I('endtime')) || $parameter['endtime'] = I('endtime');
empty(I('endtime')) || $parameter['endtime'] = I('endtime');
!isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way');
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
@ -163,6 +163,9 @@ class QueryController extends BaseController
$this->assign('pID', PID);
$this->assign('pID', PID);
$this->assign('ownId', I('own_id'));
$this->assign('ownId', I('own_id'));
$this->assign('payWayData', QueryController::$payWay);
$this->assign('payWayData', QueryController::$payWay);
if (!empty(I('team_leader_id'))) {
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
}
$this->meta_title = "订单查询";
$this->meta_title = "订单查询";
$this->display();
$this->display();
}
}
@ -185,14 +188,21 @@ class QueryController extends BaseController
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
}
$teamLeaderId = I('team_leader_id');//组长账号
$teamLeaderId = intval( I('team_leader_id') );//组长账号
if (!empty($teamLeaderId)) {
if (!empty($teamLeaderId)) {
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
if ($hasTeamLeaderPermission === false) {
if ($hasTeamLeaderPermission === false) {
$this->error('组长权限异常');
$this->error('组长权限异常');
}
}
$map['tab_user.promote_id'] = $teamLeaderId;
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
if (empty($childPromoteIds)) {
$map['tab_user.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
}
}
$promoteId = I('promote_id');//推广员账号
$promoteId = I('promote_id');//推广员账号
@ -202,18 +212,10 @@ class QueryController extends BaseController
$this->error('推广员权限异常');
$this->error('推广员权限异常');
}
}
if (!empty($map['tab_user.promote_id'])) {
$map['tab_user.promote_id'] = $promoteId;
$map['_string'] = 'tab_user.promote_id = ' . $promoteId;
} else {
$map['tab_user.promote_id'] = $promoteId;
}
}
}
if (!empty(I('own_id'))) {
if (!empty(I('own_id'))) {
if (!empty($map['_string'])) {
unset($map['_string']);
}
$map['tab_user.promote_id'] = I('own_id');//本账号
$map['tab_user.promote_id'] = I('own_id');//本账号
}
}
@ -276,6 +278,9 @@ class QueryController extends BaseController
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('pID', PID);
$this->assign('pID', PID);
$this->assign('ownId', I('own_id'));
$this->assign('ownId', I('own_id'));
if (!empty(I('team_leader_id'))) {
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
}
$this->meta_title = '注册明细';
$this->meta_title = '注册明细';
$this->display();
$this->display();
}
}
@ -998,16 +1003,25 @@ class QueryController extends BaseController
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
}
$teamLeaderId = I('team_leader_id');//组长账号
$teamLeaderId = intval( I('team_leader_id') );//组长账号
if (!empty($teamLeaderId)) {
if (!empty($teamLeaderId)) {
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
if ($hasTeamLeaderPermission === false) {
if ($hasTeamLeaderPermission === false) {
$this->error('组长权限异常');
$this->error('组长权限异常');
}
}
$userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId;
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId;
if (empty($childPromoteIds)) {
$spendWhere['tab_spend.promote_id'] = $teamLeaderId;
$userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId;
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId;
$spendWhere['tab_spend.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
}
}
$promoteId = I('promote_id');//推广员账号
$promoteId = I('promote_id');//推广员账号
@ -1017,24 +1031,12 @@ class QueryController extends BaseController
$this->error('推广员权限异常');
$this->error('推广员权限异常');
}
}
if (!empty($userPlayInfoWhere['tab_apply.promote_id'])) {
$userPlayInfoWhere['tab_user_play_info.promote_id'] = $promoteId;
$userPlayInfoWhere['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId;
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = $promoteId;
$userGameLoginWhere['_string'] = 'tab_user_game_login_record.promote_id = ' . $promoteId;
$spendWhere['tab_spend.promote_id'] = $promoteId;
$spendWhere['_string'] = 'tab_spend.promote_id = ' . $promoteId;
} else {
$userPlayInfoWhere['tab_user_play_info.promote_id'] = $promoteId;
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = $promoteId;
$spendWhere['tab_spend.promote_id'] = $promoteId;
}
}
}
if (!empty(I('own_id'))) {
if (!empty(I('own_id'))) {
if (!empty($userPlayInfoWhere['_string'])) {
unset($userPlayInfoWhere['_string']);
unset($userGameLoginWhere['_string']);
unset($spendWhere['_string']);
}
$userPlayInfoWhere['tab_user_play_info.promote_id'] = I('own_id');
$userPlayInfoWhere['tab_user_play_info.promote_id'] = I('own_id');
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = I('own_id');
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = I('own_id');
$spendWhere['tab_spend.promote_id'] = I('own_id');
$spendWhere['tab_spend.promote_id'] = I('own_id');
@ -1222,6 +1224,9 @@ class QueryController extends BaseController
$this->assign('serverData', $serverData['data']);
$this->assign('serverData', $serverData['data']);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('pID', PID);
$this->assign('pID', PID);
if (!empty(I('team_leader_id'))) {
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
}
$this->display();
$this->display();
}
}
@ -1256,10 +1261,20 @@ class QueryController extends BaseController
$this->error('组长权限异常');
$this->error('组长权限异常');
}
}
$map['tab_apply.promote_id'] = $teamLeaderId;
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
$userPlayInfoMap['tab_user_play_info.promote_id'] = $teamLeaderId;
if (empty($childPromoteIds)) {
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $teamLeaderId;
$map['tab_apply.promote_id'] = $teamLeaderId;
$spendMap['tab_spend.promote_id'] = $teamLeaderId;
$userPlayInfoMap['tab_user_play_info.promote_id'] = $teamLeaderId;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $teamLeaderId;
$spendMap['tab_spend.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$map['tab_apply.promote_id'] = ['in', $childPromoteIds];
$userPlayInfoMap['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginMap['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
$spendMap['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
}
}
$promoteId = intval(I('promote_id'));//推广员账号
$promoteId = intval(I('promote_id'));//推广员账号
@ -1269,21 +1284,14 @@ class QueryController extends BaseController
$this->error('推广员权限异常');
$this->error('推广员权限异常');
}
}
$map['_string'] = 'tab_apply.promote_id = ' . $promoteId;
$map['tab_apply.promote_id'] = $promoteId;
$userPlayInfoMap['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId;
$userPlayInfoMap['tab_user_play_info.promote_id'] = $promoteId;
$userGameLoginMap['_string'] = 'tab_user_game_login_record.promote_id = ' . $promoteId;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $promoteId;
$spendMap['_string'] = 'tab_spend.promote_id = ' . $promoteId;
$spendMap['tab_spend.promote_id'] = $promoteId;
}
}
$ownId = intval(I('own_id'));//本账号
$ownId = intval(I('own_id'));//本账号
if (!empty($ownId)) {
if (!empty($ownId)) {
if (!empty($map['_string'])) {
unset($map['_string']);
unset($userPlayInfoMap['_string']);
unset($userGameLoginMap['_string']);
unset($spendMap['_string']);
}
$map['tab_apply.promote_id'] = $ownId;
$map['tab_apply.promote_id'] = $ownId;
$userPlayInfoMap['tab_user_play_info.promote_id'] = $ownId;
$userPlayInfoMap['tab_user_play_info.promote_id'] = $ownId;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $ownId;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $ownId;
@ -1476,6 +1484,9 @@ class QueryController extends BaseController
$this->assign('serverData', $serverData['data']);
$this->assign('serverData', $serverData['data']);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('thisParentPromoteId', $thisParentPromoteId);
$this->assign('pID', PID);
$this->assign('pID', PID);
if (!empty(I('team_leader_id'))) {
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
}
$this->display();
$this->display();
}
}
@ -2165,4 +2176,21 @@ class QueryController extends BaseController
$this->assign('count', $count);
$this->assign('count', $count);
$this->display();
$this->display();
}
}
public function getChildPromoteList()
{
$promoteId = I('post.promote_id', 0);
if ($promoteId == 0) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$promoteList = getAllPromoteListByType(3, false, $promoteId);
$data['status'] = 1;
$data['data'] = $promoteList;
$this->ajaxReturn($data);
}
}
}