浏览代码

抖音穿山甲

master
huangjiajun 10 个月前
父节点
当前提交
8ddca65b0f
共有 1 个文件被更改,包括 32 次插入5 次删除
  1. +32
    -5
      csjplatform/order.go

+ 32
- 5
csjplatform/order.go 查看文件

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

正在加载...
取消
保存