我们能否找到由 Magento 特定客户邀请的电子邮件 ID(如“[电子邮件受保护]”)?
我知道我们可以通过表rewardpoints_referral,
获取已接受邀请的人的记录我的问题是,我们可以获取尚未接受的记录吗?如果可以,那么通过哪个表获取?
谢谢!
如果您使用 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