fix: category show

master
howell 4 years ago
parent cb231a4760
commit 56f569a7fc

@ -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

Loading…
Cancel
Save