饿鲜达分类查询初尝试
This commit is contained in:
@@ -58,9 +58,9 @@ func GetVendorCategories(ctx *jxcontext.Context, vendorID int, parentID string)
|
||||
}
|
||||
|
||||
// parentID 为-1表示所有
|
||||
func GetCategories(ctx *jxcontext.Context, parentID int) (catList []*dao.SkuCategoryWithVendor, err error) {
|
||||
func GetCategories(ctx *jxcontext.Context, parentID int, isExd bool) (catList []*dao.SkuCategoryWithVendor, err error) {
|
||||
db := dao.GetDB()
|
||||
cats, err := dao.GetCategories(db, parentID, 0, nil)
|
||||
cats, err := dao.GetCategories(db, parentID, 0, nil, isExd)
|
||||
if err == nil {
|
||||
var ids []int
|
||||
for _, v := range cats {
|
||||
|
||||
@@ -2435,7 +2435,7 @@ func GetTopCategoriesByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (skuCate
|
||||
}
|
||||
//推荐分类,若不满10个,则填满10个
|
||||
if (len(skuCategory) < limit && len(skuCategory) > 0) || len(skuCategory) == 0 {
|
||||
skuCategory2, err = dao.GetCategories(db, -1, 1, nil)
|
||||
skuCategory2, err = dao.GetCategories(db, -1, 1, nil, false)
|
||||
if len(skuCategory2) > 0 {
|
||||
for _, v := range skuCategory2 {
|
||||
if skuCategoryMap[v.ID] == nil {
|
||||
|
||||
Reference in New Issue
Block a user