本文整理汇总了PHP中CCrmCompany::RebuildDuplicateIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmCompany::RebuildDuplicateIndex方法的具体用法?PHP CCrmCompany::RebuildDuplicateIndex怎么用?PHP CCrmCompany::RebuildDuplicateIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmCompany
的用法示例。
在下文中一共展示了CCrmCompany::RebuildDuplicateIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$totalItemQty = isset($progressData['TOTAL_ITEMS']) ? intval($progressData['TOTAL_ITEMS']) : 0;
if ($totalItemQty <= 0) {
$totalItemQty = CCrmCompany::GetListEx(array(), array('CHECK_PERMISSIONS' => 'N'), array(), false);
}
$filter = array('CHECK_PERMISSIONS' => 'N');
if ($lastItemID > 0) {
$filter['>ID'] = $lastItemID;
}
$dbResult = CCrmCompany::GetListEx(array('ID' => 'ASC'), $filter, false, array('nTopCount' => 20), array('ID'));
$itemIDs = array();
$itemQty = 0;
if (is_object($dbResult)) {
while ($fields = $dbResult->Fetch()) {
$itemIDs[] = intval($fields['ID']);
$itemQty++;
}
}
if ($itemQty > 0) {
CCrmCompany::RebuildDuplicateIndex($itemIDs);
$progressData['TOTAL_ITEMS'] = $totalItemQty;
$processedItemQty += $itemQty;
$progressData['PROCESSED_ITEMS'] = $processedItemQty;
$progressData['LAST_ITEM_ID'] = $itemIDs[$itemQty - 1];
COption::SetOptionString('crm', '~CRM_REBUILD_COMPANY_DUP_INDEX_PROGRESS', serialize($progressData));
__CrmCompanyListEndResonse(array('STATUS' => 'PROGRESS', 'PROCESSED_ITEMS' => $processedItemQty, 'TOTAL_ITEMS' => $totalItemQty, 'SUMMARY' => GetMessage('CRM_COMPANY_LIST_REBUILD_DUPLICATE_INDEX_PROGRESS_SUMMARY', array('#PROCESSED_ITEMS#' => $processedItemQty, '#TOTAL_ITEMS#' => $totalItemQty))));
} else {
COption::RemoveOption('crm', '~CRM_REBUILD_COMPANY_DUP_INDEX');
COption::RemoveOption('crm', '~CRM_REBUILD_COMPANY_DUP_INDEX_PROGRESS');
__CrmCompanyListEndResonse(array('STATUS' => 'COMPLETED', 'PROCESSED_ITEMS' => $processedItemQty, 'TOTAL_ITEMS' => $totalItemQty, 'SUMMARY' => GetMessage('CRM_COMPANY_LIST_REBUILD_DUPLICATE_INDEX_COMPLETED_SUMMARY', array('#PROCESSED_ITEMS#' => $processedItemQty))));
}
}