From c8fb1bb20792ac70cc68d8aee82e3b7d5144b4c8 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Fri, 1 Nov 2019 17:22:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- Application/Common/Common/extend.php | 16 ++++++++++++++++ .../Controller/TestResourceController.class.php | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c4e9a6cda..c75ed83be 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ Application/Common/Conf/env.php Application/Common/Conf/pay_config.php Application/Sdk/OrderNo/ .idea/ -Uploads/ \ No newline at end of file +Uploads/ +.vscode \ No newline at end of file diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index b3c9cb626..55133a125 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1899,6 +1899,22 @@ function arr_count1($string){ } return $cou; } +/** + * 获取新推广权限后底下推广员子账号 + * @param int $id 推广员id + * @param array,string 查询字段 + * @return array + */ +function getPrmoteChlidAccount($id=0,$field="*") +{ + $promote = M("promote","tab_"); + $map['status'] = 1; + $map["chain"] = array("LIKE","%/{$id}/%"); + $data = $promote->field($field)->where($map)->select(); + if(empty($data)){return array();} + return $data; + # code... +} /** *获取推广员子账号 diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php index 4f7f381b8..34d952d40 100644 --- a/Application/Home/Controller/TestResourceController.class.php +++ b/Application/Home/Controller/TestResourceController.class.php @@ -323,7 +323,7 @@ class TestResourceController extends BaseController } //获取当前和当前子渠道的渠道id public function get_all_promote(){ - $pro_id=get_prmoote_chlid_account(session('promote_auth.pid')); + $pro_id=getPrmoteChlidAccount(get_pid(),"id"); foreach ($pro_id as $key => $value) { $pro_id1[]=$value['id']; }