本文整理汇总了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'));
}