- showapi的goodsType可能为空
This commit is contained in:
@@ -82,7 +82,7 @@ func (a *API) GetProductInfoByBarCode(barCode string) (product *ProductInfo, err
|
|||||||
OriginalSpec: showapiResBody["spec"].(string),
|
OriginalSpec: showapiResBody["spec"].(string),
|
||||||
Img: utils.Interface2String(showapiResBody["img"]),
|
Img: utils.Interface2String(showapiResBody["img"]),
|
||||||
Price: int(math.Round(utils.Str2Float64WithDefault(utils.Interface2String(showapiResBody["price"]), 0))),
|
Price: int(math.Round(utils.Str2Float64WithDefault(utils.Interface2String(showapiResBody["price"]), 0))),
|
||||||
Categories: strings.Split(showapiResBody["goodsType"].(string), ">>"),
|
Categories: strings.Split(utils.Interface2String(showapiResBody["goodsType"]), ">>"),
|
||||||
ManName: showapiResBody["manuName"].(string),
|
ManName: showapiResBody["manuName"].(string),
|
||||||
BrandName: showapiResBody["trademark"].(string),
|
BrandName: showapiResBody["trademark"].(string),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user