From b7cc3ccd77ba34fe3f8703559a46d0c0fa38b382 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 18 Dec 2020 19:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Conf/config.php | 3 ++- .../Admin/Controller/AdminController.class.php | 1 + Application/Admin/Model/DepositModel.class.php | 5 +++++ Application/Admin/View/Deposit/lists.html | 12 +++++++----- ThinkPHP/Library/Think/Auth.class.php | 11 ++++++----- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Application/Admin/Conf/config.php b/Application/Admin/Conf/config.php index e90a461e2..f9d701ed4 100644 --- a/Application/Admin/Conf/config.php +++ b/Application/Admin/Conf/config.php @@ -118,6 +118,7 @@ return array( 'SUBSITE_TABLE'=>[ "tab_spend", "sys_auth_group", - "tab_index_chart" + "tab_index_chart", + "tab_deposit" ] ); \ No newline at end of file diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 412a80191..c74e8a4e6 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -406,6 +406,7 @@ class AdminController extends Controller { } session('ADMIN_MENU_LIST.'.$controller,$menus); } + return $menus; } diff --git a/Application/Admin/Model/DepositModel.class.php b/Application/Admin/Model/DepositModel.class.php index 4370db4f0..08a0a3209 100644 --- a/Application/Admin/Model/DepositModel.class.php +++ b/Application/Admin/Model/DepositModel.class.php @@ -36,6 +36,11 @@ class DepositModel extends Model { public function __construct($name = '', $tablePrefix = '', $connection = '') { /* 设置默认的表前缀 */ $this->tablePrefix ='tab_'; + if(is_subsiteTable("tab_spend")){ + //修改连接 + $this->connection = SUBSITE_DB; + $connection = SUBSITE_DB; + } /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } diff --git a/Application/Admin/View/Deposit/lists.html b/Application/Admin/View/Deposit/lists.html index 99256ec9d..e268f6b63 100644 --- a/Application/Admin/View/Deposit/lists.html +++ b/Application/Admin/View/Deposit/lists.html @@ -28,10 +28,12 @@ @@ -212,7 +214,7 @@ - + 通知到账 diff --git a/ThinkPHP/Library/Think/Auth.class.php b/ThinkPHP/Library/Think/Auth.class.php index 4c1dea1cd..3001a6d9c 100644 --- a/ThinkPHP/Library/Think/Auth.class.php +++ b/ThinkPHP/Library/Think/Auth.class.php @@ -148,11 +148,12 @@ class Auth{ static $groups = array(); if (isset($groups[$uid])) return $groups[$uid]; - $user_groups = M() - ->table($this->_config['AUTH_GROUP_ACCESS'] . ' a') - ->where("a.uid='$uid' and g.status='1'") - ->join($this->_config['AUTH_GROUP']." g on a.group_id=g.id") - ->field('uid,group_id,title,rules')->select(); + $user_base = M()->table($this->_config['AUTH_GROUP_ACCESS'])->where("uid = {$uid}")->field('uid,group_id')->find(); + $user_rule= SM("auth_group","sys_")->where("id = {$user_base['group_id']} and status = 1")->field('title,rules')->find(); + if(empty($user_base) || empty($user_rule)){ + return []; + } + $user_groups = [array_merge($user_base,$user_rule)]; $groups[$uid]=$user_groups?:array(); return $groups[$uid]; }