I am trying to create an Inner join between two tables but am running into a problem with the second table. There is a one to many relationship with the mageuserid in Main table and the entity_id in CCP. I need to only return the store state value in ccp where ccp.attribute_id = x. How would I accomplish that?
$collectionfetch=Mage::getModel('marketplace/userprofile')->getCollection() ->addFieldToFilter('wantpartner',array('eq'=>1)) ->addFieldToFilter('partnerstatus',array('eq'=>'Seller')) ->addFieldToFilter('logopic',array('neq'=>'')); $prefix = Mage::getConfig()->getTablePrefix(); $collectionfetch->getSelect() ->join(array("ccp" => $prefix."customer_entity_varchar"),"ccp.entity_id = main_table.mageuserid",array("store_state" => "value"));