2

标题几乎描述了它,我只需要在 6-8 到 6-12 之间获得通宵运输的所有订单号。

帮助表示赞赏

4

1 回答 1

1

这是实现这一目标的至少一种方法......

$from           = "2012-06-08";
$to             = "2012-06-12";
$shippingMethod = "overnight_shipping";

$orderIds = Mage::getResourceModel('sales/order_shipment_collection')
                ->addAttributeToFilter('created_at', array(
                    'from'  => $from,
                    'to'    => $to,                    
                 ))
                ->getColumnValues('order_id')
             ;

$incrementIds = Mage::getResourceModel('sales/order_collection')
                        ->addAttributeToFilter('shipping_method', array('eq' => $shippingMethod))
                        ->addAttributeToFilter('entity_id', array('in' => $orderIds))
                        ->getColumnValues('increment_id')
                ;

echo "<ul>";
foreach($incrementIds as $incrementId) {
    echo "<li>" . $incrementId . "</li>";
}
echo "</ul>";
于 2012-06-16T19:03:41.093 回答