Roc 2 månader sedan
förälder
incheckning
7f579f6e29
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      models/data_manage/manual_classify.go

+ 5 - 3
models/data_manage/manual_classify.go

@@ -39,8 +39,8 @@ type ManualClassifyList struct {
 	ClassifyId   int
 	ClassifyName string
 	ParentId     int
-	CheckList    []int
-	Child        []*ManualClassifyList
+	CheckList    []int                 `gorm:"-"`
+	Child        []*ManualClassifyList `gorm:"-"`
 }
 
 func GetManualClassifyAll(adminId int) (items []*ManualClassifyList, err error) {
@@ -114,7 +114,9 @@ func GetManualClassifyAllV2() (items []*ManualClassifyList, err error) {
 		if err != nil {
 			return
 		}
-		newItems[i].Child = childItems
+		if childItems != nil && len(childItems) > 0 {
+			newItems[i].Child = childItems
+		}
 	}
 
 	for _, v := range newItems {