$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 SutariyaCommented Apr 18, 2017 at 9:55
-
check this and this– Minesh PatelCommented Apr 18, 2017 at 9:56
Add a comment
|
2 Answers
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));
-
can u please help me out for this : magento.stackexchange.com/questions/170516/… Commented Apr 18, 2017 at 10:28
-
-
-
then mark it as accepted to close the question @supriyamishra Commented Apr 18, 2017 at 11:05
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));
-
can u please help me out for this : magento.stackexchange.com/questions/170516/… Commented Apr 18, 2017 at 10:28