huangjiajun 3 weeks ago
parent
commit
c7d29c89d3
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      taobao/taobao.go

+ 7
- 3
taobao/taobao.go View File

@@ -12,7 +12,7 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
) )


//TaoBaoArgs is args
// TaoBaoArgs is args
type TaoBaoArgs struct { type TaoBaoArgs struct {
Keyword string Keyword string
PageIndex string PageIndex string
@@ -160,6 +160,10 @@ func (t *TB) ItemDetailByLink(l, bizSceneId string) (*Material, error) {
return nil, err return nil, err
} }
data := tmp.TbkScMaterialOptionalUpgradeResponse.ResultList.MapData[0] 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{ tmp1 := Material{
CategoryID: data.ItemBasicInfo.CategoryId, CategoryID: data.ItemBasicInfo.CategoryId,
CategoryName: data.ItemBasicInfo.CategoryName, CategoryName: data.ItemBasicInfo.CategoryName,
@@ -173,9 +177,9 @@ func (t *TB) ItemDetailByLink(l, bizSceneId string) (*Material, error) {
Title: data.ItemBasicInfo.Title, Title: data.ItemBasicInfo.Title,
ZkFinalPrice: data.PricePromotionInfo.ZkFinalPrice, ZkFinalPrice: data.PricePromotionInfo.ZkFinalPrice,
ReservePrice: data.PricePromotionInfo.ReservePrice, ReservePrice: data.PricePromotionInfo.ReservePrice,
Volume: data.ItemBasicInfo.Volume,
Volume: zhios_third_party_utils.StrToInt(data.ItemBasicInfo.Volume),
UserType: data.ItemBasicInfo.UserType, UserType: data.ItemBasicInfo.UserType,
TkTotalSales: zhios_third_party_utils.IntToStr(data.ItemBasicInfo.Volume),
TkTotalSales: data.ItemBasicInfo.Volume,
} }
tmp1.SmallImages = data.ItemBasicInfo.SmallImages tmp1.SmallImages = data.ItemBasicInfo.SmallImages
if len(data.ItemBasicInfo.SmallImages.String) == 0 { if len(data.ItemBasicInfo.SmallImages.String) == 0 {


Loading…
Cancel
Save