+ GetAllStoresVendorID
This commit is contained in:
@@ -572,28 +572,24 @@ func (c *PurchaseHandler) ListOrders(ctx *jxcontext.Context, parentTask tasksch.
|
||||
}
|
||||
fromDate := utils.Time2Date(queryDate)
|
||||
toDate := fromDate.Add(24*time.Hour - 1)
|
||||
var shopList []*ebaiapi.ShopInfo
|
||||
var vendorStoreIDs []string
|
||||
if vendorStoreID == "" {
|
||||
shopList, err = api.EbaiAPI.ShopList(ebaiapi.SysStatusAll)
|
||||
vendorStoreIDs, err = c.GetAllStoresVendorID(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
shopList = []*ebaiapi.ShopInfo{
|
||||
&ebaiapi.ShopInfo{
|
||||
BaiduShopID: utils.Str2Int64(vendorStoreID),
|
||||
},
|
||||
}
|
||||
vendorStoreIDs = []string{vendorStoreID}
|
||||
}
|
||||
task := tasksch.NewParallelTask("ebai ListOrders", nil, ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
shop := batchItemList[0].(*ebaiapi.ShopInfo)
|
||||
orderList, err := api.EbaiAPI.OrderListAll("", shop.BaiduShopID, fromDate.Unix(), toDate.Unix(), 0)
|
||||
vendorStoreID := batchItemList[0].(string)
|
||||
orderList, err := api.EbaiAPI.OrderListAll("", utils.Str2Int64(vendorStoreID), fromDate.Unix(), toDate.Unix(), 0)
|
||||
if err == nil {
|
||||
retVal = orderList
|
||||
}
|
||||
return retVal, err
|
||||
}, shopList)
|
||||
}, vendorStoreIDs)
|
||||
tasksch.HandleTask(task, parentTask, true).Run()
|
||||
orderList, err := task.GetResult(0)
|
||||
if err == nil && len(orderList) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user