Ver a proveniência

抖音穿山甲

master
huangjiajun há 9 meses
ascendente
cometimento
8ddca65b0f
1 ficheiros alterados com 32 adições e 5 eliminações
  1. +32
    -5
      csjplatform/order.go

+ 32
- 5
csjplatform/order.go Ver ficheiro

@@ -1,12 +1,14 @@
package csjplatform

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/tik_tok"
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"fmt"
"encoding/json"
"github.com/tidwall/gjson"
"strings"
)

func OrderList(args map[string]string) (string, error) {
func OrderList(args map[string]string) map[string]interface{} {
params := map[string]interface{}{
"size": zhios_third_party_utils.StrToInt(args["size"]),
"cursor": args["cursor"],
@@ -18,7 +20,32 @@ func OrderList(args map[string]string) (string, error) {
params["order_ids"] = strings.Split(args["order_ids"], ",")
}
send, err := Send(args["app_id"], args["app_secret"], "order/search", params)
fmt.Println(send)
fmt.Println(err)
return send, err
var data = map[string]interface{}{}
if err != nil {
return data
}
order := gjson.Get(send, "data.orders").String()
data["cursor"] = gjson.Get(send, "data.cursor").String()
var tmpList = make([]interface{}, 0)
err = json.Unmarshal([]byte(order), &tmpList)
if err != nil {
return data
}
var orderTmp = make([]map[string]string, 0)
statusArr := map[string]string{
"PAY_SUCC": "订单付款",
"REFUND": "订单退款",
"SETTLE": "订单结算",
"CONFIRM": "订单成功",
}
for _, v := range tmpList {

tmp := tik_tok.CommOrder(v, statusArr, "dk")
if tmp["oid"] == "" {
continue
}
orderTmp = append(orderTmp, tmp)
}
data["order"] = orderTmp
return data
}

Carregando…
Cancelar
Guardar