I have added three new columns in admin panel order grid (community ver 1.7.0.2) But now the search is not working. When I searched by Purchased On date it shows the following error message.

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

And my collection is as follows.

$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');

Please any suggestions?

有帮助吗?

解决方案

I think you should specify table name before field name while use join. like tablename.fieldname. But where is "created_at" on your code?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top