修改前:
修改后:
#打开
\app\code\core\Mage\Adminhtml\Block\Sales\Order\Grid.php
#找到 protected function _prepareCollection()方法,大约57行
添加关联
$collection->getSelect()
->join('customer_entity','main_table.customer_id = customer_entity.entity_id',
array('customer_email' => 'email')) //客户email
->join('sales_flat_order_item','main_table.entity_id = sales_flat_order_item.order_id',
array('qty_ordered' => new Zend_Db_Expr('group_concat( `sales_flat_order_item`.qty_ordered SEPARATOR ", ")'),//Qty
'sku' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.sku SEPARATOR ", ")'//SKU
)
));