baoyubo 1 月之前
父节点
当前提交
400fb0e0fd
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      routers/api/dutyManagement/contact.py

+ 1 - 2
routers/api/dutyManagement/contact.py

@@ -45,7 +45,6 @@ async def get_dict_data_by_type(
         def build_dept_tree(depts, parent_dept):
             dept_tree = []  # 初始化一个列表来存储菜单树结构
             for dept in depts:
-
                 dept_data = {
                     "id": dept.id,
                     "isShowSelect": False,
@@ -53,7 +52,7 @@ async def get_dict_data_by_type(
                     "regionPath": dept.regionPath,
                     "yzy_unitid": dept.yzy_unitid,
                 }
-                children_depts =  parent_id_get_contact_dept_list(db,dept.parent_department_id)
+                children_depts =  parent_id_get_contact_dept_list(db,dept.id)
                 if len(children_depts) > 0:
                     dept_data['children'] = build_dept_tree(children_depts, dept)
                     dept_data['dept_data'] = True