From 56f569a7fc756df805a6b50cb2e10a8806717d08 Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Fri, 14 Jan 2022 13:36:08 +0800 Subject: [PATCH] fix: category show --- internal/api/mobile/category/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/mobile/category/query.go b/internal/api/mobile/category/query.go index fa90edc..e7ccfea 100755 --- a/internal/api/mobile/category/query.go +++ b/internal/api/mobile/category/query.go @@ -77,7 +77,7 @@ func QueryAllCategories(c *gin.Context) { // 填充子类目 sub for i, _ := range categories { - err = dbc.DB.Table((&goods.Category{}).TableName()).Order("location asc").Find(&categories[i].Sub, "parent_id=? AND depth=2", categories[i].ID).Error + err = dbc.DB.Table((&goods.Category{}).TableName()).Order("location asc").Find(&categories[i].Sub, "parent_id=? AND depth=2 AND `show`=1", categories[i].ID).Error if err != nil && !gorm.IsRecordNotFoundError(err) { back.Err(c, err.Error()) return