代码优化

This commit is contained in:
wong
2025-09-11 15:16:04 +08:00
parent ecb5a741bf
commit bea5f44565
3 changed files with 26 additions and 24 deletions

View File

@@ -266,7 +266,8 @@ class CreateCompanyController extends BaseController
*/
protected function setDepartmentPrivileges(array $params): void
{
$params = ArrHelper::getValue('companyId', $params);
$params = ArrHelper::getValue('companyId=departmentId', $params);
$accountController = new \app\api\controller\AccountController();
$accountController->setPrivileges(['id' => $params['companyId']]);
}
@@ -289,11 +290,11 @@ class CreateCompanyController extends BaseController
// 创建功能账号,不可登录,也非管理员,用户也不可见
$this->createFuncUsers($params);
Db::commit();
// 设置部门权限
$this->setDepartmentPrivileges($params);
Db::commit();
return ResponseHelper::success();
} catch (Exception $e) {
Db::rollback();