Browse Source

唯品会

master
huangjiajun 4 months ago
parent
commit
da30d9b73b
2 changed files with 20 additions and 5 deletions
  1. +1
    -0
      meituan_cps/api.go
  2. +19
    -5
      wph/order.go

+ 1
- 0
meituan_cps/api.go View File

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




+ 19
- 5
wph/order.go View File

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


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


Loading…
Cancel
Save