Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
82c2bfd97c
2 changed files with 7 additions and 2 deletions
  1. +2
    -1
      md/zhimeng.go
  2. +5
    -1
      zhimeng/pdd.go

+ 2
- 1
md/zhimeng.go View File

@@ -32,6 +32,7 @@ type JDZhimengItem struct {
} }


type PDDZhimengItem struct { type PDDZhimengItem struct {
InOrderCount string `json:"inOrderCount"`
AvgDesc interface{} `json:"avg_desc"` AvgDesc interface{} `json:"avg_desc"`
AvgLgst interface{} `json:"avg_lgst"` AvgLgst interface{} `json:"avg_lgst"`
AvgServ interface{} `json:"avg_serv"` AvgServ interface{} `json:"avg_serv"`
@@ -53,7 +54,7 @@ type PDDZhimengItem struct {
GoodsImg string `json:"goods_img"` GoodsImg string `json:"goods_img"`
GoodsSign string `json:"goods_sign"` GoodsSign string `json:"goods_sign"`
GoodsMinImg string `json:"goods_min_img"` GoodsMinImg string `json:"goods_min_img"`
GoodsSales interface{} `json:"goods_sales"`
GoodsSales string `json:"goods_sales"`
GoodsTitle string `json:"goods_title"` GoodsTitle string `json:"goods_title"`
LgstPct interface{} `json:"lgst_pct"` LgstPct interface{} `json:"lgst_pct"`
MallID int `json:"mall_id"` MallID int `json:"mall_id"`


+ 5
- 1
zhimeng/pdd.go View File

@@ -19,11 +19,15 @@ func PddGoods(param map[string]interface{}) []map[string]string {
return goods return goods
} }
for _, v := range tmp.Data { for _, v := range tmp.Data {
sales := v.GoodsSales
if sales == "" {
sales = v.InOrderCount
}
var tmp = map[string]string{ var tmp = map[string]string{
"gid": v.GoodsSign, "gid": v.GoodsSign,
"title": v.GoodsTitle, "title": v.GoodsTitle,
"img": v.GoodsImg, "img": v.GoodsImg,
"sales": zhios_third_party_utils.AnyToString(v.GoodsSales),
"sales": sales,
"price": zhios_third_party_utils.Float64ToStr(v.MinGroupPrice - float64(v.CouponPrice)), "price": zhios_third_party_utils.Float64ToStr(v.MinGroupPrice - float64(v.CouponPrice)),
"cost_price": zhios_third_party_utils.Float64ToStr(v.MinNormalPrice), "cost_price": zhios_third_party_utils.Float64ToStr(v.MinNormalPrice),
"coupon": zhios_third_party_utils.IntToStr(v.CouponPrice), "coupon": zhios_third_party_utils.IntToStr(v.CouponPrice),


Loading…
Cancel
Save