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`
2
  • 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. Commented Apr 18, 2017 at 9:55
  • check this and this Commented Apr 18, 2017 at 9:56

2 Answers 2

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));
4
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));
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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