1.将部门修改为渠道,并且所有dice_表关联渠道表
2.将所有配置表,记录表设置关联渠道 3.优化后台页面设置
This commit is contained in:
@@ -40,9 +40,16 @@ class SystemUserLogic extends BaseLogic
|
||||
{
|
||||
$query = $this->search($where);
|
||||
$query->with(['depts']);
|
||||
// 超级管理员(id=1)可查看全部用户,普通管理员按部门权限过滤
|
||||
// 超级管理员(id=1)可查看全部用户,渠道管理员按本渠道过滤
|
||||
if (isset($this->adminInfo['id']) && $this->adminInfo['id'] > 1) {
|
||||
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||
$deptLogic = new SystemDeptLogic();
|
||||
$deptLogic->init($this->adminInfo);
|
||||
$deptId = $deptLogic->resolveAccessibleDeptId();
|
||||
if ($deptId > 0) {
|
||||
$query->where('dept_id', $deptId);
|
||||
} else {
|
||||
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||
}
|
||||
}
|
||||
return $this->getList($query);
|
||||
}
|
||||
@@ -70,6 +77,12 @@ class SystemUserLogic extends BaseLogic
|
||||
$data = $admin->hidden(['password'])->toArray();
|
||||
$data['roleList'] = $admin->roles->toArray() ?: [];
|
||||
$data['deptList'] = $admin->depts ? $admin->depts->toArray() : [];
|
||||
if (empty($data['deptList']) && ! empty($admin->dept_id)) {
|
||||
$dept = SystemDept::find($admin->dept_id);
|
||||
if ($dept && ! $dept->isEmpty()) {
|
||||
$data['deptList'] = $dept->toArray();
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user