Browse Source

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

zqbao 6 tháng trước cách đây
mục cha
commit
e4ebd52fcb
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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 {