1
  $collection = Mage::getModel("manager/campus")->getCollection()
        ->addFieldToFilter('regionalmanager',array('finset' => $arr))
        ->addFieldToFilter('status', array('eq' => 1));
    /* GET citymanager collection */
    $citycollection  =  Mage::getModel("manager/campus")->getCollection()
        ->addFieldToFilter('citymanager', array('eq' => $cust_id))
        ->addFieldToFilter('status', array('eq' => 1));`enter code here`
  • Can you provide more details how you want to merge? with example output of both collection and the final output which you want to achieve. – Jaimin Sutariya Apr 18 '17 at 9:55
  • check this and this – Minesh Patel Apr 18 '17 at 9:56
2

Try below code

$collection = Mage::getModel("manager/campus")->getCollection()
    ->addFieldToFilter( 
        array('regionalmanager','citymanager'), 
        array( array('finset'=>$arr),array('eq'=>$cust_id))
        )
    ->addFieldToFilter('status', array('eq' => 1));
1

try this. But this is not best pratics

 $merged_ids = array_merge($collection->getAllIds(), $citycollection->getAllIds());
$finalCollection =  Mage::getModel("manager/campus")->getCollection()
        ->addFieldToFilter('[TablePrimarykey]', array('in' => $merged_ids));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.