美团外卖的商家分类转换时,code在有值时转换为VendorCatID
This commit is contained in:
@@ -57,12 +57,15 @@ func (p *PurchaseHandler) GetStoreAllCategories(ctx *jxcontext.Context, storeID
|
||||
func convertVendorCatList(remoteCats []*mtwmapi.RetailCategoryInfo) (cats []*partner.BareCategoryInfo) {
|
||||
for _, rCat := range remoteCats {
|
||||
cat := &partner.BareCategoryInfo{
|
||||
VendorCatID: rCat.Name,
|
||||
VendorCatID: rCat.Code,
|
||||
Name: rCat.Name,
|
||||
Level: rCat.Level,
|
||||
Seq: rCat.Sequence,
|
||||
Children: convertVendorCatList(rCat.Children),
|
||||
}
|
||||
if cat.VendorCatID == "" {
|
||||
cat.VendorCatID = rCat.Name
|
||||
}
|
||||
cats = append(cats, cat)
|
||||
}
|
||||
return cats
|
||||
|
||||
Reference in New Issue
Block a user