diff --git a/pdd_union/goods.go b/pdd_union/goods.go index 43f4351..3afcf2e 100644 --- a/pdd_union/goods.go +++ b/pdd_union/goods.go @@ -13,6 +13,9 @@ func GetRecommendGoods(keyArr map[string]string, param map[string]interface{}) [ json.Unmarshal([]byte(send), &res) data := make([]map[string]interface{}, 0) for _, v := range res.GoodsBasicDetailResponse.List { + if v.GoodsName == "" { + continue + } tmp := make(map[string]interface{}) tmp["gid"] = zhios_third_party_utils.Int64ToStr(v.GoodsId) tmp["goods_title"] = v.GoodsName @@ -56,6 +59,9 @@ func GetSearchGoods(keyArr map[string]string, param map[string]interface{}) []ma json.Unmarshal([]byte(send), &res) data := make([]map[string]interface{}, 0) for _, v := range res.GoodsSearchResponse.GoodsList { + if v.GoodsName == "" { + continue + } tmp := make(map[string]interface{}) tmp["gid"] = zhios_third_party_utils.Int64ToStr(v.GoodsId) tmp["goods_title"] = v.GoodsName