我一直在這個問題上摸索着我的頭腦。任何幫助或推動正確的方向將不勝感激。如何添加另一個屬性到order_aggregated_created表?
我已經在報告 - >銷售 - >訂單下擴展了銷售報告,並創建了我自己的自定義過濾器,以按渠道報告報告。 每個訂單都有一個'channel_name'屬性來標識訂單是否來自eBay,亞馬遜等。
現在我不能爲了我的生活找出如何創建用於生成報告的sales/order_aggregated_created表。魔法在哪裏發生?我想將'channel_name'添加到order_aggregated_created表中,以便能夠通過此屬性進行過濾,但我無法弄清楚如何執行此操作。
框圖order_aggregated_created表及其屬性: http://www.magento-exchange.com/wp-content/uploads/2010/11/MAGENTO-SALES-ORDER-ER.png
Mage_Sales_Model_Resource_Report_Order_Collection就是魔術在檢索銷售總額開始,特別是如果我理解正確的這裏面
protected function _getSelectedColumns(){...}
if (!$this->isTotals()) {
$this->_selectedColumns = array(
'period' => $this->_periodFormat,
'orders_count' => 'SUM(orders_count)',
'total_qty_ordered' => 'SUM(total_qty_ordered)',
'total_qty_invoiced' => 'SUM(total_qty_invoiced)',
'total_income_amount' => 'SUM(total_income_amount)',
'total_revenue_amount' => 'SUM(total_revenue_amount)',
'total_profit_amount' => 'SUM(total_profit_amount)',
'total_invoiced_amount' => 'SUM(total_invoiced_amount)',
'total_canceled_amount' => 'SUM(total_canceled_amount)',
'total_paid_amount' => 'SUM(total_paid_amount)',
'total_refunded_amount' => 'SUM(total_refunded_amount)',
'total_tax_amount' => 'SUM(total_tax_amount)',
'total_tax_amount_actual' => 'SUM(total_tax_amount_actual)',
'total_shipping_amount' => 'SUM(total_shipping_amount)',
'total_shipping_amount_actual' => 'SUM(total_shipping_amount_actual)',
'total_discount_amount' => 'SUM(total_discount_amount)',
'total_discount_amount_actual' => 'SUM(total_discount_amount_actual)',
);
}
如果我如果將真棒可以只是'channel_name'=> $ this - > _ channelName,並在我的快樂方式。