master
ELF 5 years ago
parent 2a93ed6ec2
commit 710d7028f1

@ -867,6 +867,7 @@ class PromoteController extends BaseController
$realName = I('real_name', '');
$status = I('status', 'all');
$promoteType = I('promote_type', 0);
$parentId = I('parent_id', 0);
$loginer = $this->getLoginPromote();
$map = [];
@ -892,6 +893,9 @@ class PromoteController extends BaseController
if ($realName) {
$map['real_name'] = ['like', '%' . $realName . '%'];
}
if ($parentId) {
$map['parent_id'] = $parentId;
}
if ($status != 'all') {
$map['status'] = ['eq', $status];
}
@ -899,10 +903,8 @@ class PromoteController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
$records[$key]['idcard'] = encryption($value['idcard']);
$records[$key]['mobile_phone'] = encryption($value['mobile_phone']);
}
$ids = array_column($records, 'id');
@ -941,6 +943,23 @@ class PromoteController extends BaseController
$promoteTypeName = '推广员';
}
$parentMap = [];
$parentMap['chain'] = ['like', $loginer['chain'] . $loginer['id'] . '/%'];
$isGetParents = true;
if ($loginer['level'] == 1 && $promoteType == 1) {
$parentMap['level'] = 2;
} elseif ($loginer['level'] == 1 && $promoteType == 2) {
$parentMap['level'] = 3;
} elseif ($loginer['level'] == 2 && $promoteType == 2) {
$parentMap['level'] = 3;
} else {
$isGetParents = false;
}
$parents = null;
if ($isGetParents) {
$parents = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($parentMap)->select();
}
$this->assign('parents', $parents);
$this->assign('promoteTypeName', $promoteTypeName);
$this->assign('hasChildList', $hasChildList);
$this->assign('hasPlayerList', $hasPlayerList);

@ -31,6 +31,16 @@
<option value="2" <if condition="I('status') === '2'">selected</if>>冻结中</option>
</select>
</div>
<?php if($parents):?>
<div class="form-group fr normal_space">
<select name="parent_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择上级</option>
<?php foreach($parents as $parent):?>
<option value="<?=$parent['id']?>" <?php if(I('parent_id')==$parent['id']):?>selected<?php endif;?>><?=$parent['account']?>(<?=$parent['real_name']?>)</option>
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<div class="form-group fr normal_space">
<input type="text" name="real_name" class="txt normal_txt" id="uid" placeholder="请输入姓名" value="{:I('real_name')}">
</div>

Loading…
Cancel
Save