Amin面板添加新列后,订单网格搜索无效?

时间:2013-07-03 09:01:00

标签: php collections magento-1.7 admin orders

我在管理面板订单网格中添加了三个新列(community ver 1.7.0.2) 但现在搜索不起作用。当我按Purchased On日期搜索时,它会显示以下错误消息。

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous

我的收藏如下。

$collection = $observer->getOrderGridCollection();
        $collection->getSelect()
                   ->joinLeft('sales_flat_order_payment', 'main_table.entity_id = sales_flat_order_payment.parent_id','method')
                   ->joinLeft('customer_entity', 'main_table.customer_id = customer_entity.entity_id','email')
                   ->joinLeft('sales_flat_order_item', 'main_table.entity_id = sales_flat_order_item.order_id','name');

         $collection->getSelect()->group('main_table.entity_id');

请提出任何建议?

1 个答案:

答案 0 :(得分:0)

我认为你应该在使用join时在字段名前指定表名。像tablename.fieldname。 但是代码中的“created_at”在哪里?