|
@@ -173,13 +173,15 @@ func MarkEnableDeleteEnlishClassify(rootClassifyList, childClassifyList []*model
|
|
|
if len(rootClassifyList) == 0 && len(childClassifyList) == 0 {
|
|
|
return
|
|
|
}
|
|
|
- allClassifyList := make([]*models.EnglishClassifyList, 0)
|
|
|
- allClassifyList = append(allClassifyList, rootClassifyList...)
|
|
|
- allClassifyList = append(allClassifyList, childClassifyList...)
|
|
|
- classifyIds := make([]int, 0)
|
|
|
+
|
|
|
+ // 合并分类列表
|
|
|
+ allClassifyList := append(rootClassifyList, childClassifyList...)
|
|
|
+
|
|
|
+ classifyIds := make([]int, len(allClassifyList))
|
|
|
rootClassifyMap := make(map[int]*models.EnglishClassifyList)
|
|
|
- for _, v := range allClassifyList {
|
|
|
- classifyIds = append(classifyIds, v.Id)
|
|
|
+
|
|
|
+ for i, v := range allClassifyList {
|
|
|
+ classifyIds[i] = v.Id
|
|
|
if v.RootId == v.Id {
|
|
|
rootClassifyMap[v.Id] = v
|
|
|
}
|