修改原有框架中英文映射

This commit is contained in:
2026-03-17 18:09:10 +08:00
parent e7b8f4cae9
commit bdf50e61f5
81 changed files with 1956 additions and 735 deletions

View File

@@ -44,10 +44,10 @@ class SystemDeptLogic extends BaseLogic
$oldLevel = $data['level'] . $id . ',';
$data = $this->handleData($data);
if ($data['parent_id'] == $id) {
throw new ApiException('上级部门和当前部门不能相同');
throw new ApiException('Parent department cannot be the same as current department');
}
if (in_array($id, explode(',', $data['level']))) {
throw new ApiException('不能将上级部门设置为当前部门的子部门');
throw new ApiException('Cannot set parent department to a child of current department');
}
$newLevel = $data['level'] . $id . ',';
$deptIds = $this->model->where('level', 'like', $oldLevel . '%')->column('id');
@@ -65,11 +65,11 @@ class SystemDeptLogic extends BaseLogic
{
$num = $this->model->where('parent_id', 'in', $ids)->count();
if ($num > 0) {
throw new ApiException('该部门下存在子部门,请先删除子部门');
throw new ApiException('This department has sub-departments, please delete them first');
} else {
$count = SystemUser::where('dept_id', 'in', $ids)->count();
if ($count > 0) {
throw new ApiException('该部门下存在用户,请先删除或者转移用户');
throw new ApiException('This department has users, please delete or transfer them first');
}
return $this->model->destroy($ids);
}