瀏覽代碼

Merge branch 'bug/7882' into debug

Roc 15 小時之前
父節點
當前提交
7214959fe1
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      services/data/edb_classify.go

+ 9 - 2
services/data/edb_classify.go

@@ -1567,8 +1567,15 @@ func moveEdbClassify(parentEdbClassifyInfo, edbClassifyInfo, prevClassify, nextC
 
 	oldClassifyIdPath := edbClassifyInfo.ClassifyIdPath
 	oldClassifyNamePath := edbClassifyInfo.ClassifyNamePath
-	newClassifyNamePath := fmt.Sprint(parentEdbClassifyInfo.ClassifyNamePath, `|`, edbClassifyInfo.ClassifyName)
-	newClassifyIdPath := fmt.Sprint(parentEdbClassifyInfo.ClassifyIdPath, `,`, edbClassifyInfo.ClassifyId)
+
+	newClassifyIdPath := oldClassifyIdPath
+	newClassifyNamePath := oldClassifyNamePath
+
+	// 如果不是一级的话,那么就需要更新路径
+	if parentEdbClassifyInfo != nil {
+		newClassifyIdPath = fmt.Sprint(parentEdbClassifyInfo.ClassifyIdPath, `,`, edbClassifyInfo.ClassifyId)
+		newClassifyNamePath = fmt.Sprint(parentEdbClassifyInfo.ClassifyNamePath, `|`, edbClassifyInfo.ClassifyName)
+	}
 
 	//更新
 	if len(updateCol) > 0 {