From c7d29c89d311c4290c2af198726e125043a80d33 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 14 Oct 2024 17:28:53 +0800 Subject: [PATCH] 1 --- taobao/taobao.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 {