当我们在编写自定义插件,在管理后台的Grid中需要加入order_id做为过滤条件时,会出现以下错误。
Integrity constraint violation: 1052 Column "order_id" in where clause is ambiguous
为解决这个问题,只需要添加一句话
$this->addColumn('order_id', array(
'header' => Mage::helper('couponcode')->__('Order Id'),
'align' =>'left',
'index' => 'order_id',
'filter_index'=>'main_table.order_id', // 这个参数将会解决上述问题
));
本文介绍了一种在自定义插件开发过程中遇到的错误:在管理后台Grid中使用order_id作为过滤条件时出现的“Column 'order_id' in where clause is ambiguous”错误,并提供了解决方案,只需添加一行代码即可解决此问题。
2万+

被折叠的 条评论
为什么被折叠?



