Bladeren bron

唯品会

master
huangjiajun 3 maanden geleden
bovenliggende
commit
da30d9b73b
2 gewijzigde bestanden met toevoegingen van 20 en 5 verwijderingen
  1. +1
    -0
      meituan_cps/api.go
  2. +19
    -5
      wph/order.go

+ 1
- 0
meituan_cps/api.go Bestand weergeven

@@ -21,6 +21,7 @@ func Send(method, key, secret string, param map[string]interface{}) (string, err
paramStr := comm.GetSortJson(param)
paramStr = strings.ReplaceAll(paramStr, "\n", "")
header = GetSign(method, secret, paramStr, header)
fmt.Println(url + method)
fmt.Println(header)
fmt.Println(paramStr)



+ 19
- 5
wph/order.go Bestand weergeven

@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"github.com/tidwall/gjson"
"strings"
)

func GetOrder(serviceParam map[string]string, param string) []map[string]string {
@@ -14,34 +15,47 @@ func GetOrder(serviceParam map[string]string, param string) []map[string]string
msg := gjson.Get(post, "result.orderInfoList").String()
json.Unmarshal([]byte(msg), &data)
var list = make([]map[string]string, 0)
stateArr := map[string]string{
"已下单": "待定", "已付款": "订单付款", "已签收": "订单成功", "待结算": "订单成功", "已结算": "已完结", "已失效": "不合格",
}
for _, v := range data {
gid := ""
title := ""
img := ""
if len(v.DetailList) > 0 {
gid = v.DetailList[0].GoodsId
title = v.DetailList[0].GoodsName
img = v.DetailList[0].GoodsThumb
}
if v.OrderSubStatusName == "已下单" {
continue
}
if strings.Contains(v.ChannelTag, "own_") == false {
continue
}
tmp := map[string]string{
"title": title,
"img": img,
"oid": v.OrderSn,
"gid": gid,
"commission": "0",
"payment": "0",
"status": stateArr[v.OrderSubStatusName],
"status": v.OrderSubStatusName,
"channelTag": v.ChannelTag,
"create_time": zhios_third_party_utils.Int64ToStr(v.OrderTime / 1000),
"sign_time": zhios_third_party_utils.Int64ToStr(v.SignTime / 1000),
"newCustomer": zhios_third_party_utils.IntToStr(v.NewCustomer),
"js_time": "",
}
if v.Status == 2 {
tmp["status"] = "已完结"
}
if v.SettledTime > 0 {
if v.SettledTime > 0 && v.Settled == 1 {
tmp["js_time"] = zhios_third_party_utils.Int64ToStr(v.SettledTime / 1000)
}
var commission float64 = 0
var payment float64 = 0
for _, v1 := range v.DetailList {
if v1.Status == 0 {
continue
}
commission += zhios_third_party_utils.StrToFloat64(v1.Commission)
payment += zhios_third_party_utils.StrToFloat64(v1.CommissionTotalCost)
}


Laden…
Annuleren
Opslaan