|
@@ -1,12 +1,14 @@ |
|
|
package csjplatform |
|
|
package csjplatform |
|
|
|
|
|
|
|
|
import ( |
|
|
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" |
|
|
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" |
|
|
"strings" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func OrderList(args map[string]string) (string, error) { |
|
|
|
|
|
|
|
|
func OrderList(args map[string]string) map[string]interface{} { |
|
|
params := map[string]interface{}{ |
|
|
params := map[string]interface{}{ |
|
|
"size": zhios_third_party_utils.StrToInt(args["size"]), |
|
|
"size": zhios_third_party_utils.StrToInt(args["size"]), |
|
|
"cursor": args["cursor"], |
|
|
"cursor": args["cursor"], |
|
@@ -18,7 +20,32 @@ func OrderList(args map[string]string) (string, error) { |
|
|
params["order_ids"] = strings.Split(args["order_ids"], ",") |
|
|
params["order_ids"] = strings.Split(args["order_ids"], ",") |
|
|
} |
|
|
} |
|
|
send, err := Send(args["app_id"], args["app_secret"], "order/search", params) |
|
|
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 |
|
|
} |
|
|
} |