第三方api接口
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1年前
1年前
1年前
1234567891011121314151617181920212223242526272829303132333435363738
  1. package zhimeng
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md"
  4. zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
  5. "encoding/json"
  6. )
  7. func WphGoods(param map[string]interface{}) []map[string]string {
  8. var goods = make([]map[string]string, 0)
  9. resp, err := Send("wph_new", "seach_goods", param)
  10. if err != nil {
  11. return goods
  12. }
  13. var tmp struct {
  14. Data []md.VIPZhimengItem `json:"data"`
  15. }
  16. if err = json.Unmarshal(resp, &tmp); err != nil {
  17. return goods
  18. }
  19. for _, v := range tmp.Data {
  20. var tmp = map[string]string{
  21. "gid": v.Gid,
  22. "title": v.GoodsTitle,
  23. "img": v.GoodsImg,
  24. "sales": "",
  25. "price": zhios_third_party_utils.Float64ToStr(zhios_third_party_utils.StrToFloat64(v.GoodsPrice) - zhios_third_party_utils.StrToFloat64(v.YhqPrice)),
  26. "cost_price": v.GoodsCostPrice,
  27. "coupon": v.YhqPrice,
  28. "commission_rate": zhios_third_party_utils.AnyToString(v.CommissionRate),
  29. "commission": zhios_third_party_utils.Float64ToStr((zhios_third_party_utils.StrToFloat64(v.GoodsPrice) - zhios_third_party_utils.StrToFloat64(v.YhqPrice)) * (zhios_third_party_utils.AnyToFloat64(v.CommissionRate) / 100)),
  30. "pvd": md.PVD_VIP,
  31. "share_content": "",
  32. }
  33. goods = append(goods, tmp)
  34. }
  35. return goods
  36. }