diff --git a/platformapi/mtunionapi/order.go b/platformapi/mtunionapi/order.go new file mode 100644 index 00000000..aa9ab2a1 --- /dev/null +++ b/platformapi/mtunionapi/order.go @@ -0,0 +1,34 @@ +package mtunionapi + +import ( + "fmt" + "git.rosy.net.cn/baseapi/utils" + "time" +) + +const ( +MtUnionOrderTypeTG=0 //团购订单 +MtUnionOrderTypeJD=2 //酒店订单 +MtUnionOrderTypeWM=4 //外卖订单 +MtUnionOrderTypeHF=5 //话费订单 +MtUnionOrderTypeSG=6 //闪购订单 +) + +func (a *API) OrderList(orderType int, startTime,endTime int64,page int) (url string, err error) { + result, err := a.AccessAPI("orderList", false, map[string]interface{}{ + "ts": time.Now().Unix(), + "type": orderType, + "startTime": startTime, + "endTime":endTime, + "page":page, + "limit":100, + }) + if err == nil { + if utils.MustInterface2Int64(result["status"]) != 0 { + return "",fmt.Errorf(result["des"].(string)) + }else { + return result["data"].(string),err + } + } + return url, err +} \ No newline at end of file diff --git a/platformapi/mtunionapi/order_test.go b/platformapi/mtunionapi/order_test.go new file mode 100644 index 00000000..35be9d9e --- /dev/null +++ b/platformapi/mtunionapi/order_test.go @@ -0,0 +1 @@ +package mtunionapi