From 2e818c04f8ef6640fc07c55e4abee00bb2dd372e Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Sat, 21 Dec 2019 18:51:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=AE=B0=E5=BD=95=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 25 ++++++++++++++----- .../Controller/MemberController.class.php | 7 +++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 2b7118037..75804c516 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1706,12 +1706,25 @@ function get_admin_listOther() * @param $promote_id * @return mixed */ -function getOffspringByPromoteId($promote_id) { - $promote_ids = M('promote', 'tab_') - ->where(['chain' => ['like', "%/{$promote_id}/%"]]) - ->field('group_concat(id) as promote_ids') - ->find(); - return $promote_ids['promote_ids']; +function getOffspringByPromoteId($promote_id = null) { + if (isset($promote_id)) { + if ($promote_id ==0) {//官方渠道 + $promote_ids = '0'; + } else { + $where['chain'] = ['like', "%/{$promote_id}/%"]; + $where['id'] = $promote_id;//会长本身 + $where['_logic'] = 'or'; + $map['_complex'] = $where; + $promote_ids = M('promote', 'tab_') + ->where($map) + ->field('group_concat(id) as promote_ids') + ->find(); + $promote_ids = $promote_ids['promote_ids']; + } + } else { + $promote_ids = getPowerPromoteIds(); + } + return $promote_ids; } diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index fd6c8a73c..8f5695723 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1072,16 +1072,15 @@ class MemberController extends ThinkController if (isset($_REQUEST['promote_id'])) { if (I('promote_level') ==1) { $promote_ids = getOffspringByPromoteId($_REQUEST['promote_id']); - if (empty($promote_ids)) { - $promote_ids = -1; - } $map['promote_id'] = ['exp', "in($promote_ids)"]; } else { $map['promote_id'] = $_REQUEST['promote_id']; } unset($_REQUEST['promote_id']); + } elseif (I('promote_level') ==1) { + $promote_ids = getOffspringByPromoteId(); + $map['promote_id'] = ['exp', "in($promote_ids)"]; } - // $map['type'] = 1; // $map['login_time'] = ['exp', 'login_time<>0']; $extend = array();