diff --git a/src/controllers/PermissionOrgController.ts b/src/controllers/PermissionOrgController.ts index 0e8a7246..4c74a527 100644 --- a/src/controllers/PermissionOrgController.ts +++ b/src/controllers/PermissionOrgController.ts @@ -279,8 +279,8 @@ export class PermissionOrgController extends Controller { .leftJoinAndSelect("current_holders.orgChild2", "orgChild2") .leftJoinAndSelect("current_holders.orgChild3", "orgChild3") .leftJoinAndSelect("current_holders.orgChild4", "orgChild4") - .andWhere(`profileTree.id IN (:...profiles)`, { - profiles: profiles == null || profiles.length == 0 ? ["null"] : profiles, + .andWhere(requestBody.id == null ? "1=1" : `permissionOrg.orgRootId LIKE :rootId`, { + rootId: requestBody.id, }) .andWhere( requestBody.searchKeyword != undefined && @@ -388,8 +388,8 @@ export class PermissionOrgController extends Controller { return { id: _data.id, - profileId: _data.profileTree.id, - orgRootId: _data.orgRootTree.id, + profileId: _data.profileId, + orgRootId: _data.orgRootId, orgNew: _data.orgRootTree.orgRootName, avatar: _data.profileTree.avatar, avatarName: _data.profileTree.avatarName,