本文整理汇总了PHP中CCatalogDiscountSave::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogDiscountSave::Update方法的具体用法?PHP CCatalogDiscountSave::Update怎么用?PHP CCatalogDiscountSave::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogDiscountSave
的用法示例。
在下文中一共展示了CCatalogDiscountSave::Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ChangeActive
public function ChangeActive($intID, $boolActive = true)
{
$intID = (int) $intID;
if ($intID <= 0) {
return false;
}
return CCatalogDiscountSave::Update($intID, array('ACTIVE' => $boolActive === true ? 'Y' : 'N'), false);
}
示例2: usort
}
}
if (!empty($arFormRanges)) {
usort($arFormRanges, "__cmpRange");
}
}
if (empty($arFormRanges)) {
$arErrors[] = array('id' => 'RANGES', "text" => GetMessage('BT_CAT_DISC_SAVE_EDIT_ERR_RANGES_EMPTY'));
$bVarsFromForm = true;
}
if (!$bVarsFromForm) {
$arFields = array("XML_ID" => $_POST['XML_ID'], "SITE_ID" => $_POST['SITE_ID'], "NAME" => $_POST['NAME'], "ACTIVE" => $_POST['ACTIVE'] != "Y" ? "N" : "Y", "SORT" => intval($_POST['SORT']), "CURRENCY" => $_POST['CURRENCY'], "ACTIVE_FROM" => $_POST['ACTIVE_FROM'], "ACTIVE_TO" => $_POST['ACTIVE_TO'], "COUNT_SIZE" => $_POST['COUNT_SIZE'], "COUNT_TYPE" => $_POST['COUNT_TYPE'], "ACTION_SIZE" => $_POST['ACTION_SIZE'], "ACTION_TYPE" => $_POST['ACTION_TYPE'], "COUNT_FROM" => $_POST['COUNT_FROM'], "COUNT_TO" => $_POST['COUNT_TO'], "GROUP_IDS" => $_POST['GROUP_IDS'], "RANGES" => $arFormRanges);
}
if (!$bVarsFromForm) {
if ($ID > 0 && !$boolCopy) {
$mxRes = $obDiscSave->Update($ID, $arFields);
} else {
$ID = $obDiscSave->Add($arFields);
$mxRes = $ID > 0;
}
if ($mxRes) {
if (!empty($apply)) {
LocalRedirect("/bitrix/admin/cat_discsave_edit.php?ID=" . $ID . "&mess=ok&lang=" . urlencode(LANGUAGE_ID) . "&" . $tabControl->ActiveTabParam());
} else {
LocalRedirect("/bitrix/admin/cat_discsave_admin.php?lang=" . urlencode(LANGUAGE_ID));
}
} else {
$bVarsFromForm = true;
}
}
}
示例3:
}
else
{
$lAdmin->AddGroupError(GetMessage("BT_CAT_DISC_SAVE_ADM_ERR_UPDATE_DELETE"), $ID);
}
$DB->Rollback();
}
$DB->Commit();
break;
case "activate":
case "deactivate":
if(($rsDiscSaves = $obDiscSave->GetByID($ID)) && ($arFields = $rsDiscSaves->Fetch()))
{
$arFields["ACTIVE"] = ($_REQUEST['action'] == "activate" ? "Y" : "N");
if(!$obDiscSave->Update($ID, $arFields))
{
if ($ex = $APPLICATION->GetException())
{
$lAdmin->AddGroupError(str_replace('#ERR#',$ex->GetString(),GetMessage("BT_CAT_DISC_SAVE_ADM_ERR_UPDATE_ERR")), $ID);
}
else
{
$lAdmin->AddGroupError(GetMessage("BT_CAT_DISC_SAVE_ADM_ERR_UPDATE_UNKNOWN"), $ID);
}
}
}
else
{
$lAdmin->AddGroupError(GetMessage('BT_CAT_DISC_SAVE_ADM_ERR_UPDATE_ABSENT'), $ID);
}
示例4: ChangeActive
static public function ChangeActive($intID,$boolActive = true)
{
$intID = intval($intID);
if (0 <= $intID)
return false;
return CCatalogDiscountSave::Update($intID,array('ACTIVE' => ($boolActive === true ? 'Y' : 'N')),false);
}