|
@@ -913,17 +913,20 @@ func moveEdbClassify(parentEdbClassifyInfo, edbClassifyInfo, prevClassify, nextC
|
|
|
}
|
|
|
//判断上级id是否一致,如果不一致的话,那么需要移动该分类层级
|
|
|
if edbClassifyInfo.ParentId != parentClassifyId && parentClassifyId != 0 {
|
|
|
+ if edbClassifyInfo.Level != parentEdbClassifyInfo.Level+1 { //禁止层级调整
|
|
|
+ errMsg = "移动失败"
|
|
|
+ err = errors.New("不支持目录层级变更")
|
|
|
+ return
|
|
|
+ }
|
|
|
edbClassifyInfo.ParentId = parentEdbClassifyInfo.ClassifyId
|
|
|
edbClassifyInfo.RootId = parentEdbClassifyInfo.RootId
|
|
|
edbClassifyInfo.Level = parentEdbClassifyInfo.Level + 1
|
|
|
edbClassifyInfo.ModifyTime = time.Now()
|
|
|
updateCol = append(updateCol, "ParentId", "RootId", "Level", "ModifyTime")
|
|
|
} else if edbClassifyInfo.ParentId != parentClassifyId && parentClassifyId == 0 {
|
|
|
- edbClassifyInfo.ParentId = 0
|
|
|
- edbClassifyInfo.RootId = edbClassifyInfo.ClassifyId
|
|
|
- edbClassifyInfo.Level = 1
|
|
|
- edbClassifyInfo.ModifyTime = time.Now()
|
|
|
- updateCol = append(updateCol, "ParentId", "RootId", "Level", "ModifyTime")
|
|
|
+ errMsg = "移动失败"
|
|
|
+ err = errors.New("不支持目录层级变更")
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
if prevSort > 0 {
|