/// <summary> /// 递归查询 /// </summary> /// <param name="groupID"></param> /// <param name="idList"></param> protected static void FindChildrenID(int groupID, StringBuilder idList) {// 这里是找孩子节点 var gLst = RepositoryFactory.Group.FindList(p => p.ParentID == groupID, "ID", false).ToList(); foreach (var item in gLst) { //判断子节点是否存在,有则继续 if (RepositoryFactory.Group.Find(p => p.ParentID == item.ID) != null) return FindChildrenID(item.ID, idList); idList.Append("|" + item.ID.ToString()); } }
时间: 2024-10-15 09:05:40