From 048ed843b84b4976e944b95a3f6812663df668c9 Mon Sep 17 00:00:00 2001 From: datang Date: Mon, 24 Jul 2023 17:20:52 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/crm/controller/Callback.php | 46 +++++++++++++------------ application/crm/controller/Customer.php | 4 +-- application/crm/model/Customer.php | 9 ++--- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/application/crm/controller/Callback.php b/application/crm/controller/Callback.php index 23b2a5f..0e5df65 100644 --- a/application/crm/controller/Callback.php +++ b/application/crm/controller/Callback.php @@ -131,30 +131,32 @@ class Callback extends Controller if (isset($userInfo['userid']) && $userInfo['userid']) { Session::set('wxuser_id', $userInfo['userid']); $adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find(); - if ($adminUser) { - Session::set('user_id', $adminUser['id']); + if($adminUser['status']==1){ + if ($adminUser) { + Session::set('user_id', $adminUser['id']); - $info['userInfo'] = $adminUser; - $info['sessionId'] = session_id(); - // $info['_AUTH_LIST_'] = $dataList['rulesList']; - $info['authKey'] = 'wxwork'; - if (!Cache::get('Auth_wxwork')) { - Cache::set('Auth_wxwork', $info); + $info['userInfo'] = $adminUser; + $info['sessionId'] = session_id(); + // $info['_AUTH_LIST_'] = $dataList['rulesList']; + $info['authKey'] = 'wxwork'; + if (!Cache::get('Auth_wxwork')) { + Cache::set('Auth_wxwork', $info); + } + return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id()); + } elseif (Session::get('user_id')) { + db('admin_user')->where('id', Session::get('user_id'))->update([ + 'wxwork_id' => $userInfo['userid'] + ]); + $adminUser = db('admin_user')->where('id', Session::get('user_id'))->find(); + $info['userInfo'] = $adminUser; + $info['sessionId'] = session_id(); + // $info['_AUTH_LIST_'] = $dataList['rulesList']; + $info['authKey'] = 'wxwork'; + if (!Cache::get('Auth_wxwork')) { + Cache::set('Auth_wxwork', $info); + } + return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id()); } - return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id()); - } elseif (Session::get('user_id')) { - db('admin_user')->where('id', Session::get('user_id'))->update([ - 'wxwork_id' => $userInfo['userid'] - ]); - $adminUser = db('admin_user')->where('id', Session::get('user_id'))->find(); - $info['userInfo'] = $adminUser; - $info['sessionId'] = session_id(); - // $info['_AUTH_LIST_'] = $dataList['rulesList']; - $info['authKey'] = 'wxwork'; - if (!Cache::get('Auth_wxwork')) { - Cache::set('Auth_wxwork', $info); - } - return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id()); } } return redirect('http://web.lbschem.com:8088/'); diff --git a/application/crm/controller/Customer.php b/application/crm/controller/Customer.php index 2f32cdc..ba03b4c 100644 --- a/application/crm/controller/Customer.php +++ b/application/crm/controller/Customer.php @@ -31,7 +31,7 @@ class Customer extends ApiCommon { $action = [ 'permission' => ['exceldownload', 'setfollow', 'delete'], - 'allow' => ['read', 'system', 'count', 'poolauthority', 'level'] + 'allow' => ['read', 'system', 'count', 'poolauthority', 'level','type'] ]; Hook::listen('check_auth', $action); $request = Request::instance(); @@ -1195,7 +1195,7 @@ class Customer extends ApiCommon * @since 2021-03-29 * @author fanqi */ - public function Type() + public function type() { $data = db('admin_field')->where(['types' => 'crm_customer', 'field' => 'crm_lthugd'])->value('options'); diff --git a/application/crm/model/Customer.php b/application/crm/model/Customer.php index ba065c9..4fc33e8 100644 --- a/application/crm/model/Customer.php +++ b/application/crm/model/Customer.php @@ -155,15 +155,16 @@ class Customer extends Common }); }; } - // 过滤角色 + // 过滤角色 $groupIds = db('admin_access')->where("user_id", array("eq", $user_id))->column("group_id"); if (!in_array(1,$groupIds)){ $groupNameArray = db('admin_group')->where("pid", array("eq", 2))->where("id", array("in", $groupIds))->column("title"); - if ($groupNameArray) - + if ($groupNameArray){ $map['customer.crm_lthugd'] = array('in', $groupNameArray); + } } + # 代办事项 - 待进入公海 $remindWhere = []; if ($is_remind) { @@ -300,8 +301,8 @@ class Customer extends Common } } $data = []; - $data['list'] = $list ?: []; $data['dataCount'] = $dataCount ?: 0; + $data['list'] = $list ?: []; return $data; }