美团外卖的商家分类转换时,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) {
|
func convertVendorCatList(remoteCats []*mtwmapi.RetailCategoryInfo) (cats []*partner.BareCategoryInfo) {
|
||||||
for _, rCat := range remoteCats {
|
for _, rCat := range remoteCats {
|
||||||
cat := &partner.BareCategoryInfo{
|
cat := &partner.BareCategoryInfo{
|
||||||
VendorCatID: rCat.Name,
|
VendorCatID: rCat.Code,
|
||||||
Name: rCat.Name,
|
Name: rCat.Name,
|
||||||
Level: rCat.Level,
|
Level: rCat.Level,
|
||||||
Seq: rCat.Sequence,
|
Seq: rCat.Sequence,
|
||||||
Children: convertVendorCatList(rCat.Children),
|
Children: convertVendorCatList(rCat.Children),
|
||||||
}
|
}
|
||||||
|
if cat.VendorCatID == "" {
|
||||||
|
cat.VendorCatID = rCat.Name
|
||||||
|
}
|
||||||
cats = append(cats, cat)
|
cats = append(cats, cat)
|
||||||
}
|
}
|
||||||
return cats
|
return cats
|
||||||
|
|||||||
Reference in New Issue
Block a user