This commit is contained in:
zpc 2025-08-21 17:46:54 +08:00
parent 60f0e2e1eb
commit eed11e9e64

View File

@ -238,7 +238,7 @@ namespace ZR.Admin.WebApi.Controllers.Business
public IActionResult GetRegion([FromQuery] int deptId)
{
var list = sysDeptService.AsQueryable().Where(it => it.ParentId == deptId).Select(it => new { it.DeptId, it.DeptName }).ToList();
if (list == null)
if (list == null || list.Count == 0)
{
list = sysDeptService.AsQueryable().Where(it => it.DeptId == deptId).Select(it => new { it.DeptId, it.DeptName }).ToList();
}