0
我試圖找到一種方法來過濾getInvoiceCollection的結果在下面的功能:過濾收集發票通過created_at在Magento
// "eachInvoice" is each of the Invoice object of the order "$orders"
if ($order->hasInvoices()) {
foreach ($order->getInvoiceCollection() as $eachInvoice) {
$invoiceIncrementId = $eachInvoice->getIncrementId();
}
}
可以添加以下命令 - $過濾器> getInvoiceCollection()
$order->getInvoiceCollection()
->addAttributeToFilter('created_at', array(
'from' => $from_date,
'to' => $today,
'date' => true,));
因此,整個功能將是,是這樣做的正確方法,它看起來不像它的正確。
// "eachInvoice" is each of the Invoice object of the order "$orders"
if ($order->hasInvoices()) {
foreach ($order->getInvoiceCollection()$order->getInvoiceCollection()
->addAttributeToFilter('created_at', array('from' => $from_date,
'to' => $today, 'date' => true,)) as $eachInvoice) {
$invoiceIncrementId = $eachInvoice->getIncrementId();
}
}
什麼是「正確的方法」去做這件事?