|
|
|
@ -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);
|
|
|
|
|