小编Pau*_*ulo的帖子

magento using join in grid.php prepareCollection

Can someone tell me how to make a join within magento

Here is the problem:

<?//kleurtjes
$collection= Mage::getModel('faq/faq')->getCollection();

$collection->getSelect()->join(array('faqcat' => $this->getTable('faqcat/faqcat')), 'faqcat.faqcat_id=faq.faqcat_id' , array('faqcat.*'));

?>
Run Code Online (Sandbox Code Playgroud)

i am trying to make a join with the table faqcat where i use the key faqcat_id .

futher i want that faqcat.name + faq.faq_id are being selected cos these are the values i want to use in colums.

<?
  protected function _prepareColumns()
  {

      $this->addColumn('faq_id', array(
          'header'    => Mage::helper('faq')->__('ID'),
          'align'     =>'right',
          'width'     => '50px',
          'index' …
Run Code Online (Sandbox Code Playgroud)

join magento

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

join ×1

magento ×1