2011-03-24 5 views
0

Magento의 특정 고객이 초대 한 전자 메일 ID를 "[email protected]"이라고 할 수 있습니까?Magento의 고객 초대

나는 우리 테이블 rewardpoints_referral하여 초대를 수락 한 사람들에 대한 기록을 가져올 수 있습니다 알고

내 질문은 여기에 우리가 아직 허용되지 않습니다 레코드를 얻을 수 예, 다음, 어떤 테이블에 의한 경우 ?

감사합니다. 당신이 J2T의 포인트 및 보상 모듈을 사용하는 경우

+0

질문을 바꿔주십시오 그것은 정확한 Magento의 버전을 추가하는 데 유용합니다 그리고 당신은 다음 초대를 관리하는 확장 기능을 사용하는 경우 그것의 좋은 언급이 –

+0

이 엔터 프라이즈 버전 또는 CE인가? – balexandre

+0

Magento ver을 사용 중입니다. 1.4.0.1 CE – PHP

답변

0

(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..thanks youe 응답! rewardpoints_referral 테이블의 구조는 같지만 rewardpoints_referral_status는 초대받은 사람이 구매했는지 여부를 표시합니다. 여기에 로그인하지 않았 으면 표시되지 않습니다. – PHP

+0

@Shine - 고객으로 가입하지 않은 추천 이메일을 모두 나열하기 위해 답변을 업데이트했습니다. –