本文整理匯總了PHP中CCrmStatus::GetNextStatusId方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmStatus::GetNextStatusId方法的具體用法?PHP CCrmStatus::GetNextStatusId怎麽用?PHP CCrmStatus::GetNextStatusId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCrmStatus
的用法示例。
在下文中一共展示了CCrmStatus::GetNextStatusId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$action = isset($_REQUEST['ACTION']) ? $_REQUEST['ACTION'] : '';
if ($action === 'FIX_STATUSES') {
if (COption::GetOptionString('crm', '~CRM_FIX_STATUSES', 'N') !== 'Y') {
__CrmConfigStatusEndResonse(array('COMPLETED' => 'Y'));
}
$dbRes = $DB->Query("SELECT ENTITY_ID, STATUS_ID FROM b_crm_status WHERE SYSTEM = 'N' GROUP BY ENTITY_ID, STATUS_ID HAVING COUNT(*) > 1", false, 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
$items = array();
while ($arRes = $dbRes->Fetch()) {
$items[] = $arRes;
}
foreach ($items as $item) {
$entityID = isset($item['ENTITY_ID']) ? $item['ENTITY_ID'] : '';
$statusID = isset($item['STATUS_ID']) ? (int) $item['STATUS_ID'] : 0;
if ($entityID === '' || $statusID <= 0) {
continue;
}
$dbRes = $DB->Query("SELECT ID, SORT, NAME, SYSTEM FROM b_crm_status WHERE ENTITY_ID = '{$entityID}' AND STATUS_ID = '{$statusID}'", false, 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
$entity = new CCrmStatus($entityID);
$isFirst = true;
while ($arRes = $dbRes->Fetch()) {
if ($isFirst) {
$isFirst = false;
continue;
}
$itemID = (int) $arRes['ID'];
$error = $entity->Update($itemID, array('STATUS_ID' => $entity->GetNextStatusId(), 'SORT' => isset($arRes['SORT']) ? (int) $arRes['SORT'] : 10, 'SYSTEM' => isset($arRes['SYSTEM']) ? $arRes['SYSTEM'] : 'N', 'NAME' => isset($arRes['NAME']) ? $arRes['NAME'] : ''), array('ENABLE_STATUS_ID' => true));
}
}
COption::RemoveOption('crm', '~CRM_FIX_STATUSES');
__CrmConfigStatusEndResonse(array('COMPLETED' => 'Y'));
}