2011-03-24 97 views
0

我們可以找到Magento的特定客戶邀請他們說「[email protected]」的電子郵件地址嗎?magento中的客戶邀請

我知道我們可以取爲那些誰由表rewardpoints_referral接受了邀請的紀錄,

我的問題是,在這裏我們可以得到哪些是不能接受的記錄還沒有,如果是,那麼該表?

謝謝!

+0

請重新表述您的問題,它是添加你確切的Magento版本有用的,如果你使用的是擴展到管理的邀請,然後其良好提及 – 2011-03-24 07:56:09

+0

這是企業版還是CE? – balexandre 2011-03-24 08:01:12

+0

正在使用Magento ver。 1.4.0.1 CE – PHP 2011-03-24 08:39:15

回答

0

如果您正在使用J2T的積分和獎勵模塊(1)

這個片段將列出那些尚未註冊爲客戶推薦尚的所有電子郵件。 我已經在28000客戶羣上測試過它,速度非常快。

/* Retrieve all referrals emails */ 
$allReferrals = Mage::getModel('rewardpoints/referral')->getCollection(); 
foreach($allReferrals as $referral) { 
    $allReferralsEmails[] = $referral->getRewardpointsReferralEmail(); 
} 

/* Retrieve all signed-up customers that are referrals */ 
$allReferralsCustomers = Mage::getResourceModel('customer/customer_collection')->addFieldToFilter('email', array('in'=>$allReferralsEmails)); 
foreach($allReferralsCustomers as $allReferralsCustomer) { 
    $allReferralsCustomerData = $allReferralsCustomer->getData(); 
    $allReferralsCustomersEmails[] = $allReferralsCustomerData['email']; 
} 

/* Extract referrals that are not signed-up customers */ 
$notSignedUpReferralsEmails = array_diff($allReferralsEmails, $allReferralsCustomersEmails); 
print_r($notSignedUpReferralsEmails); 

(1)rewardpoints_referral表應該有這樣的結構:

rewardpoints_referral_id int(11)  UNSIGNED No  auto_increment       
rewardpoints_referral_parent_id int(11)  UNSIGNED No         
rewardpoints_referral_child_id int(11)  UNSIGNED Yes NULL         
rewardpoints_referral_email varchar(255) utf8_general_ci  No         
rewardpoints_referral_name varchar(255) utf8_general_ci  Yes NULL         
rewardpoints_referral_status tinyint(1)   Yes 0        
+0

@ vrnrt ..感謝您的迴應! rewardpoints_referral表具有相同的結構,但是rewardpoints_referral_status顯示瞭如果被邀請的人已經購買或未購買的狀態,其在這裏不顯示是否已經註冊。 – PHP 2011-03-25 04:31:05

+0

@Shine - 我已更新我的答案,以列出所有未作爲客戶註冊的推介電子郵件。 – 2011-03-26 12:40:52