fix(数据权限): 组织树递归查询使用 ParentId 而非 PId

修复 get-effective-by-user 展开下级组织时报 Unknown column c.PId。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-07-03 16:44:46 +08:00
parent 0bf909dc2b
commit 5f1f16c9ad

View File

@ -393,7 +393,7 @@ public class DataPermRepository(FakeRbacDbContext dbContext) : IScopedDependency
UNION ALL
SELECT c.`Id`
FROM `organization` c
INNER JOIN org_tree t ON c.`PId` = t.`Id`
INNER JOIN org_tree t ON c.`ParentId` = t.`Id`
WHERE c.`IsDeleted` = 0
)
SELECT `Id` AS `Value` FROM org_tree