|
@@ -341,7 +341,6 @@ func (this *ChartPermissionController) ClassifyTree() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- classifyIds = utils.Unique(classifyIds)
|
|
|
classifyList, err := models.GetClassifyListByIds(classifyIds)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取分类失败"
|
|
@@ -354,7 +353,6 @@ func (this *ChartPermissionController) ClassifyTree() {
|
|
|
parentClassifyIds = append(parentClassifyIds, v.ParentId)
|
|
|
}
|
|
|
}
|
|
|
- parentClassifyIds = utils.Unique(parentClassifyIds)
|
|
|
parentClassifyList, err := models.GetClassifyListByIds(parentClassifyIds)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取分类失败"
|
|
@@ -368,20 +366,19 @@ func (this *ChartPermissionController) ClassifyTree() {
|
|
|
rootClassifyIds = append(rootClassifyIds, v.ParentId)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- rootClassifyIds = utils.Unique(rootClassifyIds)
|
|
|
- rootClassifyList, err := models.GetClassifyListByIds(rootClassifyIds)
|
|
|
+ classifyIds = append(classifyIds, parentClassifyIds...)
|
|
|
+ classifyIds = append(classifyIds, rootClassifyIds...)
|
|
|
+ classifyIds = utils.Unique(classifyIds)
|
|
|
+ finalList, err := models.GetClassifyListByIds(classifyIds)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取分类失败"
|
|
|
br.ErrMsg = "获取类别信息失败,系统错误,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- classifyList = append(classifyList, parentClassifyList...)
|
|
|
- classifyList = append(classifyList, rootClassifyList...)
|
|
|
- classifyList = services.GetClassifyTree(classifyList, 0)
|
|
|
+ finalList = services.GetClassifyTree(finalList, 0)
|
|
|
|
|
|
br.Msg = "分类列表获取成功"
|
|
|
- br.Data = classifyList
|
|
|
+ br.Data = finalList
|
|
|
br.Success = true
|
|
|
br.Ret = 200
|
|
|
}
|