$marketplaceIdList->setId(array(MARKETPLACE_ID)); $request->setMarketplaceId($marketplaceIdList); $orderStatuses = new MarketplaceWebServiceOrders_Model_OrderStatusList(); $orderStatuses->setStatus(array('Unshipped', 'PartiallyShipped')); $request->setOrderStatus($orderStatuses); $start = date("Y-m-d H:i:s", $interval_start); $end = date("Y-m-d H:i:s", $interval_end); $astart = date('Y-m-d', strtotime($start)) . " " . date('H:i:s', strtotime($start)); $aend = date('Y-m-d', strtotime($end)) . " " . date('H:i:s', strtotime($end)); $interval_start = $interval_end; $interval_end = strtotime($interval_time, $interval_end); echo $astart . '<br>'; echo $aend; $request->setCreatedAfter(new DateTime($astart, new DateTimeZone('UTC'))); $request->setCreatedBefore(new DateTime($aend, new DateTimeZone('UTC'))); $errorstatus = invokeListOrders($service, $request); echo '$errorstatus:' . $errorstatus . "<br><br>"; } echo "finish"; /** * List Orders Action Sample * ListOrders can be used to find orders that meet the specified criteria. * * @param MarketplaceWebServiceOrders_Interface $service instance of MarketplaceWebServiceOrders_Interface * @param mixed $request MarketplaceWebServiceOrders_Model_ListOrders or array of parameters */ function invokeListOrders(MarketplaceWebServiceOrders_Interface $service, $request) { global $user, $account, $dbcon, $defaultstoreid; try { $response = $service->listOrders($request);
$astart = date('Y-m-d', strtotime($tstart)) . " " . date('H:i:s', strtotime($tstart)); $aend = date('Y-m-d', strtotime($tend)) . " " . date('H:i:s', strtotime($tend)); echo '<br>'; echo $astart; echo $aend; $request->setCreatedAfter(new DateTime($astart, new DateTimeZone('UTC'))); $request->setCreatedBefore(new DateTime($aend, new DateTimeZone('UTC'))); $errorstatus = invokeListOrders($service, $request); if ($errorstatus == 88) { invokeListOrders($service, $request); } if ($errorstatus == 88) { invokeListOrders($service, $request); } if ($errorstatus == 88) { invokeListOrders($service, $request); } $i++; //if($i ==3 ) die(); echo $astart . ' ** ' . $aend . '<br>'; if (strtotime($tend) > strtotime($end)) { echo 'pp销售额已经同步完成<br>'; break; } } } // Set the order statuses for this ListOrdersRequest (optional) // $orderStatuses = new MarketplaceWebServiceOrders_Model_OrderStatusList(); // $orderStatuses->setStatus(array('Shipped')); // $request->setOrderStatus($orderStatuses); // Set the Fulfillment Channel for this ListOrdersRequest (optional)