|
@@ -472,3 +472,19 @@ func GetChildClassifyByClassifyId(targetClassifyId int, source int) (targetList
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetClassifyListRemoveNoExcel 去除没有表格的分类
|
|
|
+func GetClassifyListRemoveNoExcel(classifyList []*excel.ExcelClassifyItems) []*excel.ExcelClassifyItems {
|
|
|
+ res := make([]*excel.ExcelClassifyItems, 0)
|
|
|
+ for _, classify := range classifyList {
|
|
|
+ if classify.ExcelInfoId > 0 {
|
|
|
+ res = append(res, classify)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ classify.Children = append([]*excel.ExcelClassifyItems{}, GetClassifyListRemoveNoExcel(classify.Children)...)
|
|
|
+ if len(classify.Children) > 0 {
|
|
|
+ res = append(res, classify)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res
|
|
|
+}
|