|
@@ -184,7 +184,7 @@ class LoginService extends Service
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function getPersonRoleAndPermissions($employee, $tree_type) {
|
|
|
|
|
|
|
+ public static function getPersonRoleAndPermissions($employee) {
|
|
|
// 初始化返回结构
|
|
// 初始化返回结构
|
|
|
$result = [
|
|
$result = [
|
|
|
'role_ids' => [],
|
|
'role_ids' => [],
|
|
@@ -196,18 +196,10 @@ class LoginService extends Service
|
|
|
// return $result;
|
|
// return $result;
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- $role_ids = Role::from('role as a')
|
|
|
|
|
- ->join('employee_role as b','b.role_id','a.id')
|
|
|
|
|
- ->where('a.del_time',0)
|
|
|
|
|
- ->where('b.del_time',0)
|
|
|
|
|
- ->where('b.employee_id', $employee['id'])
|
|
|
|
|
- ->where('a.tree_type', $tree_type)
|
|
|
|
|
- ->pluck('b.role_id')
|
|
|
|
|
|
|
+ $role_ids = EmployeeRole::where('del_time', 0)
|
|
|
|
|
+ ->where('employee_id', $employee['id'])
|
|
|
|
|
+ ->pluck('role_id')
|
|
|
->toArray();
|
|
->toArray();
|
|
|
-// $role_ids = EmployeeRole::where('del_time', 0)
|
|
|
|
|
-// ->where('employee_id', $employee['id'])
|
|
|
|
|
-// ->pluck('role_id')
|
|
|
|
|
-// ->toArray();
|
|
|
|
|
|
|
|
|
|
if (empty($role_ids)) return $result;
|
|
if (empty($role_ids)) return $result;
|
|
|
$result['role_ids'] = $role_ids;
|
|
$result['role_ids'] = $role_ids;
|