首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Magento连接和左连接函数

Magento连接和左连接函数
EN

Stack Overflow用户
提问于 2015-08-17 17:05:54
回答 1查看 911关注 0票数 1

我是否可以将团购/优惠券表格加入到我的网格集合中?这是我的准备集合函数

代码语言:javascript
复制
protected function _prepareCollection()
{   
    $orderIds = Mage::getModel('sales/order_item')->getCollection()->addFieldToFilter('product_id', $this->getRequest()->getParam('id'))->getColumnValues('order_id');  
    $collection = Mage::getResourceModel('sales/order_grid_collection')->addAttributeToFilter('entity_id', array('in' => $orderIds));

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

现在我想让它与groupon_coupons表连接起来

我想加入表格,这样我就可以从我的订单网格中过滤优惠券代码和安全代码。

EN

回答 1

Stack Overflow用户

发布于 2015-08-24 14:41:50

将此行添加到集合->join(array('tblalias' => 'tablename'),'main_table.fildname = tblalias.fildname',array('fildfromsecondtable' => 'tblalias.filedname'))

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32046476

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档