From da30d9b73b621fa85dea089be311df76aaa84526 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 25 Jul 2024 15:51:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AF=E5=93=81=E4=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meituan_cps/api.go | 1 + wph/order.go | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/meituan_cps/api.go b/meituan_cps/api.go index 0adfb1a..5bc5ae7 100644 --- a/meituan_cps/api.go +++ b/meituan_cps/api.go @@ -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) diff --git a/wph/order.go b/wph/order.go index 7c57b3d..659bf3d 100644 --- a/wph/order.go +++ b/wph/order.go @@ -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) }