瀏覽代碼

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

zqbao 6 月之前
父節點
當前提交
e4ebd52fcb
共有 1 個文件被更改,包括 6 次插入0 次删除
  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 {