- jd.GetStoreOrderInfoList

This commit is contained in:
gazebo
2019-01-11 15:09:55 +08:00
parent 5f995dc927
commit bfb0b139fa
2 changed files with 19 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package jdapi
import (
"fmt"
"net/http"
"net/url"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi"
@@ -90,3 +91,13 @@ func (a *API) GetStoreOrderInfo(orderId string) (storeOrderInfo map[string]inter
}
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
}

View File

@@ -29,3 +29,11 @@ func TestGetStoreOrderInfo(t *testing.T) {
}
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))
}