|
@@ -273,9 +273,21 @@ func (this *MaterialController) DeleteMaterialClassifyCheck() {
|
|
br.ErrMsg = "获取分类信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取分类信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- classifyIds := strings.Split(classifyInfo.LevelPath, ",")
|
|
|
|
|
|
+ // 查找当前分类以及子分类, 截取分类ID之后的字符串
|
|
|
|
+ // 获取所有子分类
|
|
|
|
+ childList, e := material.GetMaterialClassifyByLevelPath(classifyInfo.LevelPath)
|
|
|
|
+ if e != nil {
|
|
|
|
+ err = fmt.Errorf("保存分类失败,Err:" + e.Error())
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ classifyIds := make([]int, 0)
|
|
|
|
+ if len(childList) > 0 {
|
|
|
|
+ for _, item := range childList {
|
|
|
|
+ classifyIds = append(classifyIds, item.ClassifyId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if len(classifyIds) > 0 {
|
|
if len(classifyIds) > 0 {
|
|
- //判断素材库分类下,是否含有素材库
|
|
|
|
count, e := material.GetMaterialInfoCountByClassifyIds(classifyIds)
|
|
count, e := material.GetMaterialInfoCountByClassifyIds(classifyIds)
|
|
if e != nil {
|
|
if e != nil {
|
|
br.Msg = "删除失败"
|
|
br.Msg = "删除失败"
|
|
@@ -349,9 +361,21 @@ func (this *MaterialController) DeleteMaterialClassify() {
|
|
br.ErrMsg = "获取分类信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取分类信息失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- classifyIds := strings.Split(classifyInfo.LevelPath, ",")
|
|
|
|
|
|
+ // 查找当前分类以及子分类, 截取分类ID之后的字符串
|
|
|
|
+ // 获取所有子分类
|
|
|
|
+ childList, e := material.GetMaterialClassifyByLevelPath(classifyInfo.LevelPath)
|
|
|
|
+ if e != nil {
|
|
|
|
+ err = fmt.Errorf("保存分类失败,Err:" + e.Error())
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ classifyIds := make([]int, 0)
|
|
|
|
+ if len(childList) > 0 {
|
|
|
|
+ for _, item := range childList {
|
|
|
|
+ classifyIds = append(classifyIds, item.ClassifyId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if len(classifyIds) > 0 {
|
|
if len(classifyIds) > 0 {
|
|
- //判断素材库分类下,是否含有素材库
|
|
|
|
count, e := material.GetMaterialInfoCountByClassifyIds(classifyIds)
|
|
count, e := material.GetMaterialInfoCountByClassifyIds(classifyIds)
|
|
if e != nil {
|
|
if e != nil {
|
|
br.Msg = "删除失败"
|
|
br.Msg = "删除失败"
|