|
|
@ -163,12 +163,13 @@ class CampusPersonRoleService extends BaseAdminService |
|
|
return $campusModel->select()->toArray(); |
|
|
return $campusModel->select()->toArray(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getPersonnelAll(){ |
|
|
public function getPersonnelAll($campus_id){ |
|
|
$person_ids = $this->model->column("person_id"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$personnelModel = new Personnel(); |
|
|
$personnelModel = new Personnel(); |
|
|
return $personnelModel->where([['id','not in',$person_ids]])->select()->toArray(); |
|
|
return $personnelModel->when($campus_id, function ($query) use ($campus_id) { |
|
|
|
|
|
$query->where('campus_id', $campus_id); |
|
|
|
|
|
})->where('status',2) |
|
|
|
|
|
->select() |
|
|
|
|
|
->toArray(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getSysRoleAll($data){ |
|
|
public function getSysRoleAll($data){ |
|
|
@ -181,12 +182,12 @@ class CampusPersonRoleService extends BaseAdminService |
|
|
->where('role_key', '<>', '') |
|
|
->where('role_key', '<>', '') |
|
|
->where('role_name', '<>', '超级管理员'); |
|
|
->where('role_name', '<>', '超级管理员'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 如果dept_id不为0,则按部门过滤;如果为0则显示所有可用角色 |
|
|
// 如果dept_id不为0,则按部门过滤;如果为0则显示所有可用角色 |
|
|
if (isset($data['dept_id']) && $data['dept_id'] > 0) { |
|
|
if (isset($data['dept_id']) && $data['dept_id'] > 0) { |
|
|
$query->where('dept_id', $data['dept_id']); |
|
|
$query->where('dept_id', $data['dept_id']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $query->select()->toArray(); |
|
|
return $query->select()->toArray(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|