我们有一个包含交货日期的表格,我想将其添加到sales/order/grid中的adminhtml中。 我遇到的问题是左连接示例不为我工作,我没有选择。在magento中创建自定义集合
Mage/Adminhtml/Block/Sales/Order/Grid.php
方法IM现在正试图为创造_prepareCollection())自定义查询
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT * FROM mage_sales_flat_order_grid
left join mage_aw_deliverydate_delivery
on mage_sales_flat_order_grid.entity_id =
mage_aw_deliverydate_delivery.order_id';
$collection = $readConnection->fetchAll($query);
//$collection = Mage::getResourceModel($this->_getCollectionClass());
//$this->setCollection($collection);
return parent::_prepareCollection();
然后我_prepareColumns添加此列码(
$this->addColumn('delivery_date', array(
'header' => 'delivery_date',
'index' => 'delivery_date',
'type' => 'datetime',
'width' => '100px',
));
当我查看后台中的订单网格时,我甚至没有看到新的列。
任何帮助表示赞赏!
? –
我如何做到这一点
– SinisterGlitch请检查答案 –