增加部门长分级

master
sunke 5 years ago
parent 381a2e0a67
commit 8633efd7d6

@ -47,44 +47,47 @@ class QueryController extends BaseController
// }
$map1['chain'] = ['like', '%' . PID . '/' . '%'];
$rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select();
$map1['chain'] = ['like','%'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if (empty($rs)) {
if(empty($rs)) {
$map['tab_spend.promote_id'] = PID;
} else {
foreach ($rs as $rsKey => $rsValue) {
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id . ',';
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
$levelPromote = I('level_promote', []);
$promote = $this->getLoginPromote();
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if (empty($ids)) {
$ids = array();
if(empty($ids)) {
$ids = array();
}
if (empty($levelPromote)) {
array_push($ids, PID);
if(empty($levelPromote)) {
array_push($ids,PID);
}
array_push($ids, $queryPromote['id']);
array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['tab_spend.promote_id'] = ['in', $ids];
$map['tab_spend.promote_id'] = ['in',$ids];
} else {
}else {
$map['_string'] = '1<>1';
}
if (!empty(I('own_id'))) {
$map['tab_spend.promote_id'] = $promote['id'];//本账号
$map['tab_spend.promote_id'] = $queryPromote['id'];//本账号
}
if (!empty(I('begtime')) && empty(I('endtime'))) {
@ -157,6 +160,9 @@ class QueryController extends BaseController
empty(I('own_id')) || $parameter['own_id'] = I('own_id');
empty(I('begtime')) || $parameter['begtime'] = I('begtime');
empty(I('endtime')) || $parameter['endtime'] = I('endtime');
empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2');
empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3');
empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4');
!isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way');
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
@ -193,6 +199,7 @@ class QueryController extends BaseController
$row = 10;
}
//$childPromoteIds = getAllChildPromoteList(3);
// if (empty($childPromoteIds)) {
// $map['tab_user.promote_id'] = PID;
@ -201,44 +208,48 @@ class QueryController extends BaseController
//
// $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();
// $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)) {
if(empty($rs)) {
$map['tab_user.promote_id'] = PID;
} else {
foreach ($rs as $rsKey => $rsValue) {
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id . ',';
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
$levelPromote = I('level_promote', []);
$promote = $this->getLoginPromote();
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if (empty($ids)) {
$ids = array();
if(empty($ids)) {
$ids = array();
}
if (empty($levelPromote)) {
array_push($ids, PID);
if(empty($levelPromote)) {
array_push($ids,PID);
}
array_push($ids, $queryPromote['id']);
array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['tab_user.promote_id'] = ['in', $ids];
$map['tab_user.promote_id'] = ['in',$ids];
} else {
}else {
$map['_string'] = '1<>1';
}
if (!empty(I('own_id'))) {
$map['tab_user.promote_id'] = $promote['id'];//本账号
$map['tab_user.promote_id'] = $queryPromote['id'];//本账号
}
if (!empty(I('begtime')) && empty(I('endtime'))) {
@ -288,7 +299,9 @@ class QueryController extends BaseController
empty(I('account')) || $parameter['account'] = I('account');
empty(I('begtime')) || $parameter['begtime'] = I('begtime');
empty(I('endtime')) || $parameter['endtime'] = I('endtime');
empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2');
empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3');
empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4');
$thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID
$page = set_pagination($count, $row, $parameter);
if ($page) {

@ -63,55 +63,24 @@
</div>
<div class="trunk-content article">
<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">
<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>
<volist name=":getAllPromoteListByType(2)" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</select>
</div>
</if>
<eq name="pID|isMinPromote" value="0">
<div class="form-group normal_space fl">
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:130px;">
<option value="0">推广员账号</option>
<notempty name="teamLeaderData">
<volist name="teamLeaderData" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<if condition="($_GET['team_leader_id'] gt 0 or $thisParentPromoteId gt 0) or ($_GET['team_leader_id'] eq 0 and $thisParentPromoteId gt 0)">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</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}">
<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}">
<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}">
<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>

@ -35,53 +35,25 @@
</div>
<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">
<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>
<volist name=":getAllPromoteListByType(2)" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</select>
</div>
</if>
<eq name="pID|isMinPromote" value="0">
<div class="form-group normal_space fl">
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:130px;">
<option value="0">推广员账号</option>
<notempty name="teamLeaderData">
<volist name="teamLeaderData" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<if condition="($_GET['team_leader_id'] gt 0 or $thisParentPromoteId gt 0) or ($_GET['team_leader_id'] eq 0 and $thisParentPromoteId gt 0)">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</eq>-->
<form action="{:U('Query/register',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<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}">
<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}">
<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}">
<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>
@ -109,8 +81,7 @@
</div>
<div class="form-group normal_space fl">
<input type="submit" class="submit" id='submit' url="{:U('Query/register','model='.$model['name'],false)}"
value="查询">
<input type="submit" class="submit normal_space" value="查询">
</div>
<div class="form-group normal_space fl" style="margin-left: 60px;">
@ -119,7 +90,7 @@
<input type="hidden" name="own_id" id="own_id" value="{:empty(I('own_id'))?0:I('own_id')}" />
</label>
</div>
<!-- </form>-->
</form>
</div>
</div>
<div class="page-list query-register-list">

Loading…
Cancel
Save