タグ付けされた質問 「join」

1
結合クエリでMagentoコレクションでgroup byを使用する方法
モジュールの管理グリッドでは、このコードを使用してコレクションを取得し、顧客IDでグループ化します $collection = Mage::getModel('referafriend/statistics')->getCollection(); $collection->getSelect()->group('entity_id'); $this->setCollection($collection); しかし、ここでは、それぞれに対して名前やメールなどの顧客情報のレンダラーとフィルター機能を使用する必要がありますentity_id。顧客モデルをモジュールのテーブルに参加させたい。このために私はこのコードを書きました $collection = Mage::getModel('customer/customer')->getCollection() ->addNameToSelect(); $collection->getSelect()->join(array('refer' => 'table_name'),'refer.entity_id = e.entity_id' ); $collection->getSelect()->group('entity_id'); $collection->addAttributeToSelect('*'); しかし、それは私にこのエラーを与えます SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in group statement is ambiguous どんな助けも大歓迎です。
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.