diff --git a/taobao/taobao.go b/taobao/taobao.go index c6842ee..a25dfca 100644 --- a/taobao/taobao.go +++ b/taobao/taobao.go @@ -12,7 +12,7 @@ import ( "xorm.io/xorm" ) -//TaoBaoArgs is args +// TaoBaoArgs is args type TaoBaoArgs struct { Keyword string PageIndex string @@ -160,6 +160,10 @@ func (t *TB) ItemDetailByLink(l, bizSceneId string) (*Material, error) { return nil, err } data := tmp.TbkScMaterialOptionalUpgradeResponse.ResultList.MapData[0] + if strings.Contains(data.ItemBasicInfo.Volume, "万+") { + data.ItemBasicInfo.Volume = zhios_third_party_utils.IntToStr(zhios_third_party_utils.StrToInt(strings.ReplaceAll(data.ItemBasicInfo.Volume, "万+", "")) * 10000) + } + data.ItemBasicInfo.Volume = strings.ReplaceAll(data.ItemBasicInfo.Volume, "+", "") tmp1 := Material{ CategoryID: data.ItemBasicInfo.CategoryId, CategoryName: data.ItemBasicInfo.CategoryName, @@ -173,9 +177,9 @@ func (t *TB) ItemDetailByLink(l, bizSceneId string) (*Material, error) { Title: data.ItemBasicInfo.Title, ZkFinalPrice: data.PricePromotionInfo.ZkFinalPrice, ReservePrice: data.PricePromotionInfo.ReservePrice, - Volume: data.ItemBasicInfo.Volume, + Volume: zhios_third_party_utils.StrToInt(data.ItemBasicInfo.Volume), UserType: data.ItemBasicInfo.UserType, - TkTotalSales: zhios_third_party_utils.IntToStr(data.ItemBasicInfo.Volume), + TkTotalSales: data.ItemBasicInfo.Volume, } tmp1.SmallImages = data.ItemBasicInfo.SmallImages if len(data.ItemBasicInfo.SmallImages.String) == 0 {