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

@ -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/');

@ -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');

@ -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;
}

Loading…
Cancel
Save