dyb
戴余标 1 year ago
parent 8473cdc3d5
commit 048ed843b8

@ -131,30 +131,32 @@ class Callback extends Controller
if (isset($userInfo['userid']) && $userInfo['userid']) { if (isset($userInfo['userid']) && $userInfo['userid']) {
Session::set('wxuser_id', $userInfo['userid']); Session::set('wxuser_id', $userInfo['userid']);
$adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find(); $adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find();
if ($adminUser) { if($adminUser['status']==1){
Session::set('user_id', $adminUser['id']); if ($adminUser) {
Session::set('user_id', $adminUser['id']);
$info['userInfo'] = $adminUser; $info['userInfo'] = $adminUser;
$info['sessionId'] = session_id(); $info['sessionId'] = session_id();
// $info['_AUTH_LIST_'] = $dataList['rulesList']; // $info['_AUTH_LIST_'] = $dataList['rulesList'];
$info['authKey'] = 'wxwork'; $info['authKey'] = 'wxwork';
if (!Cache::get('Auth_wxwork')) { if (!Cache::get('Auth_wxwork')) {
Cache::set('Auth_wxwork', $info); 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/'); return redirect('http://web.lbschem.com:8088/');

@ -31,7 +31,7 @@ class Customer extends ApiCommon
{ {
$action = [ $action = [
'permission' => ['exceldownload', 'setfollow', 'delete'], 'permission' => ['exceldownload', 'setfollow', 'delete'],
'allow' => ['read', 'system', 'count', 'poolauthority', 'level'] 'allow' => ['read', 'system', 'count', 'poolauthority', 'level','type']
]; ];
Hook::listen('check_auth', $action); Hook::listen('check_auth', $action);
$request = Request::instance(); $request = Request::instance();
@ -1195,7 +1195,7 @@ class Customer extends ApiCommon
* @since 2021-03-29 * @since 2021-03-29
* @author fanqi * @author fanqi
*/ */
public function Type() public function type()
{ {
$data = db('admin_field')->where(['types' => 'crm_customer', 'field' => 'crm_lthugd'])->value('options'); $data = db('admin_field')->where(['types' => 'crm_customer', 'field' => 'crm_lthugd'])->value('options');

@ -155,15 +155,16 @@ class Customer extends Common
}); });
}; };
} }
// 过滤角色
// 过滤角色
$groupIds = db('admin_access')->where("user_id", array("eq", $user_id))->column("group_id"); $groupIds = db('admin_access')->where("user_id", array("eq", $user_id))->column("group_id");
if (!in_array(1,$groupIds)){ if (!in_array(1,$groupIds)){
$groupNameArray = db('admin_group')->where("pid", array("eq", 2))->where("id", array("in", $groupIds))->column("title"); $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); $map['customer.crm_lthugd'] = array('in', $groupNameArray);
}
} }
# 代办事项 - 待进入公海 # 代办事项 - 待进入公海
$remindWhere = []; $remindWhere = [];
if ($is_remind) { if ($is_remind) {
@ -300,8 +301,8 @@ class Customer extends Common
} }
} }
$data = []; $data = [];
$data['list'] = $list ?: [];
$data['dataCount'] = $dataCount ?: 0; $data['dataCount'] = $dataCount ?: 0;
$data['list'] = $list ?: [];
return $data; return $data;
} }

Loading…
Cancel
Save