I think you should specify table name before field name while use join. like tablename.fieldname. But where is "created_at" on your code?
Amin panel Order grid search is is not working after adding new columns?
-
02-06-2022 - |
Question
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?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow