|
@@ -156,7 +156,7 @@ func moveAiPredictModelClassify(parentClassify, edbClassifyInfo, prevClassify, n
|
|
|
updateCol := make([]string, 0)
|
|
|
|
|
|
// 移动对象为分类, 判断分类是否存在
|
|
|
- if edbClassifyInfo != nil {
|
|
|
+ if edbClassifyInfo != nil && edbClassifyInfo.AiPredictModelClassifyId > 0 {
|
|
|
oldParentId := edbClassifyInfo.ParentId
|
|
|
oldLevel := edbClassifyInfo.Level
|
|
|
var classifyIds []int
|
|
@@ -271,7 +271,7 @@ func moveAiPredictModelClassify(parentClassify, edbClassifyInfo, prevClassify, n
|
|
|
}
|
|
|
|
|
|
//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
|
|
|
- if firstClassify != nil && firstClassify.Sort == 0 {
|
|
|
+ if firstClassify != nil && firstClassify.AiPredictModelClassifyId > 0 && firstClassify.Sort == 0 {
|
|
|
updateSortStr := ` sort + 1 `
|
|
|
_ = aiPredictModel.UpdateAiPredictModelClassifySortByParentId(parentClassifyId, firstClassify.AiPredictModelClassifyId-1, 0, updateSortStr)
|
|
|
//该分类下的所有指标也需要+1
|
|
@@ -286,7 +286,7 @@ func moveAiPredictModelClassify(parentClassify, edbClassifyInfo, prevClassify, n
|
|
|
}
|
|
|
|
|
|
//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
|
|
|
- if firstEdb != nil && firstEdb.Sort == 0 {
|
|
|
+ if firstEdb != nil && firstEdb.AiPredictModelIndexId > 0 && firstEdb.Sort == 0 {
|
|
|
updateSortStr := ` sort + 1 `
|
|
|
_ = aiPredictModel.UpdateAiPredictModelIndexSortByClassifyId(parentClassifyId, 0, firstEdb.AiPredictModelIndexId-1, updateSortStr)
|
|
|
_ = aiPredictModel.UpdateAiPredictModelClassifySortByParentId(parentClassifyId, 0, 0, updateSortStr)
|
|
@@ -403,7 +403,7 @@ func moveAiPredictModelClassify(parentClassify, edbClassifyInfo, prevClassify, n
|
|
|
}
|
|
|
|
|
|
//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
|
|
|
- if firstClassify != nil && firstClassify.Sort == 0 {
|
|
|
+ if firstClassify != nil && firstClassify.AiPredictModelClassifyId> 0 && firstClassify.Sort == 0 {
|
|
|
updateSortStr := ` sort + 1 `
|
|
|
_ = aiPredictModel.UpdateAiPredictModelClassifySortByParentId(parentClassifyId, firstClassify.AiPredictModelClassifyId-1, 0, updateSortStr)
|
|
|
//该分类下的所有指标也需要+1
|
|
@@ -418,7 +418,7 @@ func moveAiPredictModelClassify(parentClassify, edbClassifyInfo, prevClassify, n
|
|
|
}
|
|
|
|
|
|
//如果该分类下存在其他分类,且第一个其他分类的排序等于0,那么需要调整排序
|
|
|
- if firstEdb != nil && firstEdb.Sort == 0 {
|
|
|
+ if firstEdb != nil && firstEdb.AiPredictModelIndexId > 0 && firstEdb.Sort == 0 {
|
|
|
updateSortStr := ` sort + 1 `
|
|
|
_ = aiPredictModel.UpdateAiPredictModelIndexSortByClassifyId(parentClassifyId, 0, firstEdb.AiPredictModelIndexId-1, updateSortStr)
|
|
|
_ = aiPredictModel.UpdateAiPredictModelClassifySortByParentId(parentClassifyId, 0, 0, updateSortStr)
|