From 82c2bfd97cf54eb6ebee3052548ed3b0df459946 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 7 Dec 2023 09:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/zhimeng.go | 3 ++- zhimeng/pdd.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/md/zhimeng.go b/md/zhimeng.go index 5a74598..2891587 100644 --- a/md/zhimeng.go +++ b/md/zhimeng.go @@ -32,6 +32,7 @@ type JDZhimengItem struct { } type PDDZhimengItem struct { + InOrderCount string `json:"inOrderCount"` AvgDesc interface{} `json:"avg_desc"` AvgLgst interface{} `json:"avg_lgst"` AvgServ interface{} `json:"avg_serv"` @@ -53,7 +54,7 @@ type PDDZhimengItem struct { GoodsImg string `json:"goods_img"` GoodsSign string `json:"goods_sign"` GoodsMinImg string `json:"goods_min_img"` - GoodsSales interface{} `json:"goods_sales"` + GoodsSales string `json:"goods_sales"` GoodsTitle string `json:"goods_title"` LgstPct interface{} `json:"lgst_pct"` MallID int `json:"mall_id"` diff --git a/zhimeng/pdd.go b/zhimeng/pdd.go index f1930b6..2c989ff 100644 --- a/zhimeng/pdd.go +++ b/zhimeng/pdd.go @@ -19,11 +19,15 @@ func PddGoods(param map[string]interface{}) []map[string]string { return goods } for _, v := range tmp.Data { + sales := v.GoodsSales + if sales == "" { + sales = v.InOrderCount + } var tmp = map[string]string{ "gid": v.GoodsSign, "title": v.GoodsTitle, "img": v.GoodsImg, - "sales": zhios_third_party_utils.AnyToString(v.GoodsSales), + "sales": sales, "price": zhios_third_party_utils.Float64ToStr(v.MinGroupPrice - float64(v.CouponPrice)), "cost_price": zhios_third_party_utils.Float64ToStr(v.MinNormalPrice), "coupon": zhios_third_party_utils.IntToStr(v.CouponPrice),