Integrity constraint violation: 1052 Column "order_id" in where clause is ambiguous

来源:互联网 发布:海岩剧 知乎 编辑:程序博客网 时间:2024/05/20 00:50

当我们在编写自定义插件,在管理后台的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', // 这个参数将会解决上述问题));


原创粉丝点击