本文整理匯總了PHP中CCrmDeal::RebuildStatistics方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmDeal::RebuildStatistics方法的具體用法?PHP CCrmDeal::RebuildStatistics怎麽用?PHP CCrmDeal::RebuildStatistics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCrmDeal
的用法示例。
在下文中一共展示了CCrmDeal::RebuildStatistics方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$totalItemQty = isset($progressData['TOTAL_ITEMS']) ? intval($progressData['TOTAL_ITEMS']) : 0;
if ($totalItemQty <= 0) {
$totalItemQty = CCrmDeal::GetListEx(array(), array('CHECK_PERMISSIONS' => 'N'), array(), false);
}
$filter = array('CHECK_PERMISSIONS' => 'N');
if ($lastItemID > 0) {
$filter['>ID'] = $lastItemID;
}
$dbResult = CCrmDeal::GetListEx(array('ID' => 'ASC'), $filter, false, array('nTopCount' => 20), array('ID'));
$itemIDs = array();
$itemQty = 0;
if (is_object($dbResult)) {
while ($fields = $dbResult->Fetch()) {
$itemIDs[] = (int) $fields['ID'];
$itemQty++;
}
}
if ($itemQty > 0) {
CCrmDeal::RebuildStatistics($itemIDs);
$progressData['TOTAL_ITEMS'] = $totalItemQty;
$processedItemQty += $itemQty;
$progressData['PROCESSED_ITEMS'] = $processedItemQty;
$progressData['LAST_ITEM_ID'] = $itemIDs[$itemQty - 1];
COption::SetOptionString('crm', '~CRM_REBUILD_DEAL_STATISTICS_PROGRESS', serialize($progressData));
__CrmDealListEndResonse(array('STATUS' => 'PROGRESS', 'PROCESSED_ITEMS' => $processedItemQty, 'TOTAL_ITEMS' => $totalItemQty, 'SUMMARY' => GetMessage('CRM_DEAL_LIST_REBUILD_STATISTICS_PROGRESS_SUMMARY', array('#PROCESSED_ITEMS#' => $processedItemQty, '#TOTAL_ITEMS#' => $totalItemQty))));
} else {
COption::RemoveOption('crm', '~CRM_REBUILD_DEAL_STATISTICS');
COption::RemoveOption('crm', '~CRM_REBUILD_DEAL_STATISTICS_PROGRESS');
__CrmDealListEndResonse(array('STATUS' => 'COMPLETED', 'PROCESSED_ITEMS' => $processedItemQty, 'TOTAL_ITEMS' => $totalItemQty, 'SUMMARY' => GetMessage('CRM_DEAL_LIST_REBUILD_STATISTICS_COMPLETED_SUMMARY', array('#PROCESSED_ITEMS#' => $processedItemQty))));
}
}