|
|
|
@ -44,14 +44,21 @@ class QueryController extends BaseController
|
|
|
|
|
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$teamLeaderId = I('team_leader_id');//组长账号
|
|
|
|
|
$teamLeaderId = intval(I('team_leader_id'));//组长账号
|
|
|
|
|
if (!empty($teamLeaderId)) {
|
|
|
|
|
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
|
|
|
|
|
if ($hasTeamLeaderPermission === false) {
|
|
|
|
|
$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');//推广员账号
|
|
|
|
@ -164,6 +171,9 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
$this->assign('ownId', I('own_id'));
|
|
|
|
|
$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->display();
|
|
|
|
|
}
|
|
|
|
@ -186,14 +196,21 @@ class QueryController extends BaseController
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$teamLeaderId = I('team_leader_id');//组长账号
|
|
|
|
|
$teamLeaderId = intval(I('team_leader_id'));//组长账号
|
|
|
|
|
if (!empty($teamLeaderId)) {
|
|
|
|
|
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
|
|
|
|
|
if ($hasTeamLeaderPermission === false) {
|
|
|
|
|
$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');//推广员账号
|
|
|
|
@ -277,6 +294,9 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('thisParentPromoteId', $thisParentPromoteId);
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
$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->display();
|
|
|
|
|
}
|
|
|
|
@ -979,16 +999,25 @@ class QueryController extends BaseController
|
|
|
|
|
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$teamLeaderId = I('team_leader_id');//组长账号
|
|
|
|
|
$teamLeaderId = intval(I('team_leader_id'));//组长账号
|
|
|
|
|
if (!empty($teamLeaderId)) {
|
|
|
|
|
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
|
|
|
|
|
if ($hasTeamLeaderPermission === false) {
|
|
|
|
|
$this->error('组长权限异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$userPlayInfoWhere['tab_user_play_info.promote_id'] = $teamLeaderId;
|
|
|
|
|
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = $teamLeaderId;
|
|
|
|
|
$spendWhere['tab_spend.promote_id'] = $teamLeaderId;
|
|
|
|
|
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
|
|
|
|
|
if (empty($childPromoteIds)) {
|
|
|
|
|
$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');//推广员账号
|
|
|
|
@ -998,24 +1027,12 @@ class QueryController extends BaseController
|
|
|
|
|
$this->error('推广员权限异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($userPlayInfoWhere['tab_apply.promote_id'])) {
|
|
|
|
|
$userPlayInfoWhere['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId;
|
|
|
|
|
$userGameLoginWhere['_string'] = 'tab_user_game_login_record.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;
|
|
|
|
|
}
|
|
|
|
|
$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($userPlayInfoWhere['_string'])) {
|
|
|
|
|
unset($userPlayInfoWhere['_string']);
|
|
|
|
|
unset($userGameLoginWhere['_string']);
|
|
|
|
|
unset($spendWhere['_string']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$userPlayInfoWhere['tab_user_play_info.promote_id'] = I('own_id');
|
|
|
|
|
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = I('own_id');
|
|
|
|
|
$spendWhere['tab_spend.promote_id'] = I('own_id');
|
|
|
|
@ -1203,6 +1220,9 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('serverData', $serverData['data']);
|
|
|
|
|
$this->assign('thisParentPromoteId', $thisParentPromoteId);
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
if (!empty(I('team_leader_id'))) {
|
|
|
|
|
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
|
|
|
|
|
}
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1237,10 +1257,20 @@ class QueryController extends BaseController
|
|
|
|
|
$this->error('组长权限异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$map['tab_apply.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;
|
|
|
|
|
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
|
|
|
|
|
if (empty($childPromoteIds)) {
|
|
|
|
|
$map['tab_apply.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'));//推广员账号
|
|
|
|
@ -1250,21 +1280,14 @@ class QueryController extends BaseController
|
|
|
|
|
$this->error('推广员权限异常');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$map['_string'] = 'tab_apply.promote_id = ' . $promoteId;
|
|
|
|
|
$userPlayInfoMap['_string'] = 'tab_user_play_info.promote_id = ' . $promoteId;
|
|
|
|
|
$userGameLoginMap['_string'] = 'tab_user_game_login_record.promote_id = ' . $promoteId;
|
|
|
|
|
$spendMap['_string'] = 'tab_spend.promote_id = ' . $promoteId;
|
|
|
|
|
$map['tab_apply.promote_id'] = $promoteId;
|
|
|
|
|
$userPlayInfoMap['tab_user_play_info.promote_id'] = $promoteId;
|
|
|
|
|
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $promoteId;
|
|
|
|
|
$spendMap['tab_spend.promote_id'] = $promoteId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$ownId = intval(I('own_id'));//本账号
|
|
|
|
|
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;
|
|
|
|
|
$userPlayInfoMap['tab_user_play_info.promote_id'] = $ownId;
|
|
|
|
|
$userGameLoginMap['tab_user_game_login_record.promote_id'] = $ownId;
|
|
|
|
@ -1457,6 +1480,9 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('serverData', $serverData['data']);
|
|
|
|
|
$this->assign('thisParentPromoteId', $thisParentPromoteId);
|
|
|
|
|
$this->assign('pID', PID);
|
|
|
|
|
if (!empty(I('team_leader_id'))) {
|
|
|
|
|
$this->assign('teamLeaderData', getAllPromoteListByType(1, false, intval(I('team_leader_id'))));
|
|
|
|
|
}
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2146,4 +2172,21 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('count', $count);
|
|
|
|
|
$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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|