|
- package jingtuitui
-
- import (
- "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md"
- zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
- "encoding/json"
- "github.com/tidwall/gjson"
- )
-
- func JingtuituiGetCircleList(params map[string]string) []map[string]string {
- var goods = make([]map[string]string, 0)
- resp, err := SendReq("http://japi.jingtuitui.com/api/get_circle_list", params)
- if err != nil {
- return goods
- }
- data := gjson.Get(string(resp), "result.data").String()
- if data == "" {
- return goods
- }
- var oldGoods []md.JingtuituiGetCircleList
- json.Unmarshal([]byte(data), &oldGoods)
- for _, v := range oldGoods {
- var tmp = map[string]string{
- "gid": zhios_third_party_utils.AnyToString(v.GoodsID),
- "title": v.GoodsInfo.GoodsName,
- "img": v.GoodsInfo.GoodsImg,
- "sales": zhios_third_party_utils.IntToStr(v.GoodsInfo.InOrderCount30Days),
- "price": zhios_third_party_utils.AnyToString(v.GoodsInfo.FinalPrice),
- "cost_price": zhios_third_party_utils.AnyToString(v.GoodsInfo.GoodsPrice),
- "coupon": zhios_third_party_utils.AnyToString(v.GoodsInfo.DiscountPrice),
- "commission_rate": zhios_third_party_utils.AnyToString(v.GoodsInfo.CommissionShare),
- "commission": zhios_third_party_utils.Float64ToStr(zhios_third_party_utils.AnyToFloat64(v.GoodsInfo.FinalPrice) * (zhios_third_party_utils.AnyToFloat64(v.GoodsInfo.CommissionShare) / 100)),
- "pvd": md.PVD_JD,
- "share_content": v.CircleContent[0],
- }
- goods = append(goods, tmp)
- }
- return goods
- }
|