diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index ccfd6e84f..d3858aa4b 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -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); diff --git a/Application/Home/View/default/Promote/children.html b/Application/Home/View/default/Promote/children.html index 52e049283..d0a0eaef7 100644 --- a/Application/Home/View/default/Promote/children.html +++ b/Application/Home/View/default/Promote/children.html @@ -31,6 +31,16 @@ + +
+ +
+