|
@@ -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) |
|
|
} |
|
|
} |
|
|