magento 中的客户邀请

发布于 2024-10-27 00:33:39 字数 281 浏览 1 评论 0原文

我们能否找到由 Magento 特定客户邀请的电子邮件 ID,例如“[email]受保护]”?

我知道我们可以通过rewardpoints_referral表获取已接受邀请的记录,

我的问题是我们可以获取尚未接受的记录吗?如果可以,那么通过哪个表获取?

谢谢!

Can we find email-id of them which are invited by specific customer of Magento say "[email protected]"?

I know We can fetch the record for those who have accepted the invitation by table rewardpoints_referral,

My question is here Can we get the records which are not accepted yet and if yes, then by which table?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

廻憶裏菂餘溫 2024-11-03 00:33:39

如果您使用 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                               

If you are using J2T's Points and Reward module (1)

This snippet will list all emails of referrals that have not signed up as customer yet.
I've tested it on a 28000 customer base and it is very fast.

/* 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) the rewardpoints_referral table should have this structure :

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                               
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文