2013-10-29 29 views
1

我在Magento上编码,我注册时遇到了麻烦。 我不知道如何以及为什么会导致此问题。 在customer_entity表中,电子邮件地址的创建次数是2个具有2个entity_id的帐户的两倍。我使用的Magento版本1.5Magento不会避免重复的电子邮件注册

例子:

entity_id | email   | created_at 
495  | [email protected] | 2013-10-19 09:47:01 
496  | [email protected] | 2013-10-19 09:47:03 

在我customer_entity表,大约有超过1.000的记录,但有30条记录存在重复的电子邮件像上面

的例子请帮我这个。谢谢

回答

0
$customerObj = Mage::getModel("customer/customer"); 
foreach (Mage::app()->getWebsites() as $website) { 
    $customerObj->setWebsiteId($website->getId()); 
    $customerObj->loadByEmail($customer['email']); 
    if ($customerObj->getId()) { 
     $message = "duplicate found" ; 
     return $message; 
    } 

} 
相关问题