второй этап импорта пользателей в лиды

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CModule::IncludeModule('nbsriter');
CModule::IncludeModule('nbs_extended_api');
CModule::IncludeModule('nbs_ad_campaign');
CModule::IncludeModule('crm');
if(!CModule::IncludeModule("refcode"))
exit ("Ref code");
if(!CModule::IncludeModule("nbs_crm_sync"))
echo "Модуль не установлен! ";
$el = CIBlockElement::GetList(array("ID"=>"DESC"), array( "IBLOCK_ID" => 107), false, false,
array("ID","NAME", "PROPERTY_S_USER", "PROPERTY_S_EVENT", "PROPERTY_BP_REG", "PROPERTY_BP_ZDOROVIE", "PROPERTY_BP_ANKETA"));
while($userD = $el->Fetch())
{
if($userD['PROPERTY_BP_ANKETA_VALUE'] != NULL)
{
UserLead::onUserStartAnketing($userD['PROPERTY_S_USER_VALUE']);
}
if($userD['PROPERTY_BP_ZDOROVIE_VALUE'] !=NULL )
{
UserLead::onUserEnteringZdorovie($userD['PROPERTY_BP_ZDOROVIE_VALUE'], $userD['PROPERTY_S_USER_VALUE']);
}
}
NBSExtendedAPI::xvardump("USer imported in CRM =)");