注册明细,订单查询 修改等级结构

master
sunke 5 years ago
parent 750a6dc596
commit f15c6e68eb

@ -37,44 +37,54 @@ class QueryController extends BaseController
$row = 10;
}
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$map['tab_spend.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
$teamLeaderId = intval(I('team_leader_id'));//组长账号
if (!empty($teamLeaderId)) {
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
if ($hasTeamLeaderPermission === false) {
$this->error('组长权限异常');
}
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
if (empty($childPromoteIds)) {
$map['tab_spend.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
// $childPromoteIds = getAllChildPromoteList(3);
// if (empty($childPromoteIds)) {
// $map['tab_spend.promote_id'] = PID;
// } else {
// $childPromoteIds .= ',' . PID;
//
// $map['tab_spend.promote_id'] = ['in', $childPromoteIds];
// }
$map1['chain'] = ['like','%'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_user.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
$promoteId = I('promote_id');//推广员账号
if (!empty($promoteId)) {
$hasPromotePermission = hasPromotePermission(PID, $promoteId);
if ($hasPromotePermission === false) {
$this->error('推广员权限异常');
}
$map['tab_spend.promote_id'] = $promoteId;
$levelPromote = I('level_promote', []);
$promote = $this->getLoginPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2['chain'] = ['like', $queryPromote['chain'].$queryPromote['id'].'/%'];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if(empty($ids)) {
$ids = array();
}
if(empty($levelPromote)) {
array_push($ids,PID);
}
array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['tab_spend.promote_id'] = ['in',$ids];
}else {
$map['_string'] = '1<>1';
}
if (!empty(I('own_id'))) {
$map['tab_spend.promote_id'] = I('own_id');//本账号
$map['tab_spend.promote_id'] = $promote['id'];//本账号
}
if (!empty(I('begtime')) && empty(I('endtime'))) {
@ -183,44 +193,52 @@ class QueryController extends BaseController
$row = 10;
}
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
//$childPromoteIds = getAllChildPromoteList(3);
// if (empty($childPromoteIds)) {
// $map['tab_user.promote_id'] = PID;
// } else {
// $childPromoteIds .= ',' . PID;
//
// $map['tab_user.promote_id'] = ['in', $childPromoteIds];
// }
// $map['tab_user.promote_id'] = ['like','%'.PID.'/'.'%'];
$map1['chain'] = ['like','%'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($rs)) {
$map['tab_user.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
$teamLeaderId = intval(I('team_leader_id'));//组长账号
if (!empty($teamLeaderId)) {
$hasTeamLeaderPermission = hasPromotePermission(PID, $teamLeaderId);
if ($hasTeamLeaderPermission === false) {
$this->error('组长权限异常');
}
$childPromoteIds = getAllChildPromoteList(3, $teamLeaderId);
if (empty($childPromoteIds)) {
$map['tab_user.promote_id'] = $teamLeaderId;
} else {
$childPromoteIds = $teamLeaderId . ',' . $childPromoteIds;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
$promoteId = I('promote_id');//推广员账号
if (!empty($promoteId)) {
$hasPromotePermission = hasPromotePermission(PID, $promoteId);
if ($hasPromotePermission === false) {
$this->error('推广员权限异常');
}
$map['tab_user.promote_id'] = $promoteId;
$levelPromote = I('level_promote', []);
$promote = $this->getLoginPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2['chain'] = ['like', $queryPromote['chain'].$queryPromote['id'].'/%'];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if(empty($ids)) {
$ids = array();
}
if(empty($levelPromote)) {
array_push($ids,PID);
}
array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['tab_user.promote_id'] = ['in',$ids];
}else {
$map['_string'] = '1<>1';
}
if (!empty(I('own_id'))) {
$map['tab_user.promote_id'] = I('own_id');//本账号
$map['tab_user.promote_id'] = $promote['id'];//本账号
}
if (!empty(I('begtime')) && empty(I('endtime'))) {

@ -65,7 +65,7 @@
<div class="trunk-search clearfix">
<!-- <form action="{:U('Query/recharge',['version'=>I(" request.version-->
<!-- ",1),'row'=>I("get.row")])}" method="post" enctype="multipart/form-data" class="normal_form">-->
<if condition="$thisParentPromoteId eq 0">
<!-- <if condition="$thisParentPromoteId eq 0">
<div class="form-group normal_space fl">
<select id="team_leader_id" name="team_leader_id" class="reselect select_gallery" style="min-width:130px;">
<option value="0">组长账号</option>
@ -92,7 +92,30 @@
</if>
</select>
</div>
</eq>
</eq>-->
<input type="hidden" id="top-promote-id" value="{$loginer.id}">
<if condition="$loginer.level elt 1">
<div class="form-group normal_space fl">
<select name="level_promote[2]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="2" data-val="{:I('level_promote', [])[2] ?? 0}">
<option value="0">请选择部门长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 2">
<div class="form-group normal_space fl">
<select name="level_promote[3]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="3" data-val="{:I('level_promote', [])[3] ?? 0}">
<option value="0">请选择组长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 3">
<div class="form-group normal_space fl">
<select name="level_promote[4]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="4" data-val="{:I('level_promote', [])[4] ?? 0}">
<option value="0">请选择推广员</option>
</select>
</div>
</if>
<div class="form-group normal_space fl">
<select id="relation_game_id" name="relation_game_id" class="reselect select_gallery">
@ -243,7 +266,10 @@
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$().ready(function () {
setValue('relation_game_id', {$Think.request.relation_game_id |default = '""'});
setValue('sdk_version', {$Think.request.sdk_version |default = '""'});

@ -36,7 +36,7 @@
<div class="trunk-content article">
<div class="trunk-search clearfix">
<!-- <form action="{:U('Query/register',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">-->
<if condition="$thisParentPromoteId eq 0">
<!-- <if condition="$thisParentPromoteId eq 0">
<div class="form-group normal_space fl">
<select id="team_leader_id" name="team_leader_id" class="reselect select_gallery" style="min-width:130px;">
<option value="0">组长账号</option>
@ -63,7 +63,29 @@
</if>
</select>
</div>
</eq>
</eq>-->
<input type="hidden" id="top-promote-id" value="{$loginer.id}">
<if condition="$loginer.level elt 1">
<div class="form-group fl">
<select name="level_promote[2]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="2" data-val="{:I('level_promote', [])[2] ?? 0}">
<option value="0">请选择部门长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 2">
<div class="form-group fl">
<select name="level_promote[3]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="3" data-val="{:I('level_promote', [])[3] ?? 0}">
<option value="0">请选择组长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 3">
<div class="form-group fl">
<select name="level_promote[4]" class="level-promote reselect select_gallery" style="width: 220px;" data-level="4" data-val="{:I('level_promote', [])[4] ?? 0}">
<option value="0">请选择推广员</option>
</select>
</div>
</if>
<div class="form-group fl">
<input type="text" name="account" class="txt normal_txt" placeholder="请输入玩家账号"
@ -155,7 +177,10 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$().ready(function () {
setValue('team_leader_id', {$Think.request.team_leader_id |default = '""'});
setValue('promote_id', {$Think.request.promote_id |default = 0});
@ -272,4 +297,5 @@
});
});
</script>
</block>

Loading…
Cancel
Save