Browse Source

fix:分类添加时的根节点id

zqbao 6 months ago
parent
commit
e4ebd52fcb
1 changed files with 6 additions and 0 deletions
  1. 6 0
      services/edb_monitor/edb_monitor_classify.go

+ 6 - 0
services/edb_monitor/edb_monitor_classify.go

@@ -44,6 +44,12 @@ func SaveEdbMonitorClassify(req request.EdbMonitorClassifySaveReq) (msg string,
 	var rootId int
 	if parentClassify != nil {
 		rootId = parentClassify.RootId
+		if rootId == 0 {
+			rootId = parentClassify.ParentId
+		}
+		if rootId == 0 {
+			rootId = parentClassify.ClassifyId
+		}
 	}
 
 	if req.ClassifyId > 0 {