- jd.GetStoreOrderInfoList
This commit is contained in:
@@ -3,6 +3,7 @@ package jdapi
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi"
|
"git.rosy.net.cn/baseapi"
|
||||||
"git.rosy.net.cn/baseapi/platformapi"
|
"git.rosy.net.cn/baseapi/platformapi"
|
||||||
@@ -90,3 +91,13 @@ func (a *API) GetStoreOrderInfo(orderId string) (storeOrderInfo map[string]inter
|
|||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *API) GetStoreOrderInfoList(fromTime, toTime string) (storeOrderList []map[string]interface{}, err error) {
|
||||||
|
retVal, err := a.AccessStorePage(fmt.Sprintf("order/newManager/tabQuery/all?o2oOrderType=10000&pageNo=1&pageSize=9999&orderBy=&desc=true&startTimeQuery=%s&endTimeQuery=%s&stationNo=", url.QueryEscape(fromTime), url.QueryEscape(toTime)))
|
||||||
|
// baseapi.SugarLogger.Debug(utils.Format4Output(retVal, false))
|
||||||
|
if err == nil {
|
||||||
|
resultList := retVal["result"].(map[string]interface{})["newOrderinfoMains"].(map[string]interface{})["resultList"].([]interface{})
|
||||||
|
return utils.Slice2MapSlice(resultList), nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,3 +29,11 @@ func TestGetStoreOrderInfo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
baseapi.SugarLogger.Debug(utils.Format4Output(orderInfo, false))
|
baseapi.SugarLogger.Debug(utils.Format4Output(orderInfo, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetStoreOrderInfoList(t *testing.T) {
|
||||||
|
orderInfoList, err := jdapi.GetStoreOrderInfoList("2018-10-01 00:00:00", "2018-10-01 00:59:59")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
baseapi.SugarLogger.Debug(utils.Format4Output(orderInfoList, false))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user