@@ -19,6 +19,7 @@ type TikTokGoods struct { | |||||
Cid string `json:"cid"` | Cid string `json:"cid"` | ||||
ActivityStartTime string `json:"promotion_start_time"` | ActivityStartTime string `json:"promotion_start_time"` | ||||
ActivityEndTime string `json:"promotion_end_time"` | ActivityEndTime string `json:"promotion_end_time"` | ||||
PublicCommission string `json:"public_commission"` | |||||
} | } | ||||
type TikTokGoodsLm struct { | type TikTokGoodsLm struct { | ||||
@@ -187,6 +187,10 @@ func CommGoodsDetail(goods TikTokGoodsLm) TikTokGoods { | |||||
ShopTotalScore: ShopTotalScore, | ShopTotalScore: ShopTotalScore, | ||||
YhqPrice: "0", | YhqPrice: "0", | ||||
} | } | ||||
if goods.ActivityCosRatio > 0 { | |||||
tmp.PublicCommission = tmp.Commission | |||||
tmp.Commission = zhios_third_party_utils.AnyToString(goods.ActivityCosRatio / 100) | |||||
} | |||||
if zhios_third_party_utils.StrToFloat64(tmp.Price) == 0 { | if zhios_third_party_utils.StrToFloat64(tmp.Price) == 0 { | ||||
tmp.Price = tmp.CostPrice | tmp.Price = tmp.CostPrice | ||||
} else { | } else { | ||||
@@ -70,11 +70,7 @@ func ActivityProduct(args map[string]string) []TikTokGoods { | |||||
return goodsList | return goodsList | ||||
} | } | ||||
for _, v := range lmData.Data.Data { | for _, v := range lmData.Data.Data { | ||||
if v.ActivityCosRatio > 0 { | |||||
v.CosRatio = v.ActivityCosRatio / 100 | |||||
} | |||||
tmp := CommGoodsDetail(v) | tmp := CommGoodsDetail(v) | ||||
goodsList = append(goodsList, tmp) | goodsList = append(goodsList, tmp) | ||||
} | } | ||||
fmt.Println(string(zhios_third_party_utils.Serialize(goodsList))) | fmt.Println(string(zhios_third_party_utils.Serialize(goodsList))) | ||||