I create a custom attribute last_sync
for customer custom attribute, i need to filter it if this attribute is null OR greater than created_at
, right now i'm using code like this:
$collections = Mage::getModel('customer/customer')->getCollection()
->addAttributeToSelect('*');
foreach ($collections as $collection)
{
$result = array();
$result = $collection->getData();
if(is_null($result['last_sync']) || ($result['last_sync'] < $result['updated_at']))
{
$results[] = $result;
}
}
return $results;
the problem for the above code is the speed time, because i have to loop through each customer data than filter it