当前位置: 首页>>代码示例>>PHP>>正文


PHP CCatalogDiscountSave::CheckFields方法代码示例

本文整理汇总了PHP中CCatalogDiscountSave::CheckFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogDiscountSave::CheckFields方法的具体用法?PHP CCatalogDiscountSave::CheckFields怎么用?PHP CCatalogDiscountSave::CheckFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCatalogDiscountSave的用法示例。


在下文中一共展示了CCatalogDiscountSave::CheckFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Add

 public function Add($arFields, $boolCalc = false)
 {
     global $DB;
     if (!CCatalogDiscountSave::CheckFields("ADD", $arFields)) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_catalog_discount", $arFields);
     $strSql = "INSERT INTO b_catalog_discount(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = intval($DB->LastID());
     if ($ID > 0) {
         foreach ($arFields['RANGES'] as &$arRange) {
             $arRange['DISCOUNT_ID'] = $ID;
             $arInsert = $DB->PrepareInsert("b_catalog_disc_save_range", $arRange);
             $strSql = "INSERT INTO b_catalog_disc_save_range(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         foreach ($arFields['GROUP_IDS'] as &$intGroupID) {
             $strSql = "INSERT INTO b_catalog_disc_save_group(DISCOUNT_ID,GROUP_ID) VALUES(" . $ID . "," . $intGroupID . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         $boolCalc = $boolCalc === true ? true : false;
         if ($boolCalc) {
             CCatalogDiscountSave::UserDiscountCalc($ID, $arFields, false);
         }
     }
     return $ID;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:discount_save.php

示例2: Update

 public function Update($intID, $arFields, $boolCalc = false)
 {
     global $DB;
     $intID = (int) $intID;
     if ($intID <= 0) {
         return false;
     }
     if (!CCatalogDiscountSave::CheckFields('UPDATE', $arFields, $intID)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_catalog_discount", $arFields);
     if (!empty($strUpdate)) {
         $strSql = "update b_catalog_discount SET " . $strUpdate . " where ID = " . $intID . " and TYPE = " . self::ENTITY_ID;
         $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     }
     if (!empty($arFields['RANGES'])) {
         $DB->Query("delete from b_catalog_disc_save_range where DISCOUNT_ID = " . $intID, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         foreach ($arFields['RANGES'] as &$arRange) {
             $arRange['DISCOUNT_ID'] = $intID;
             $arInsert = $DB->PrepareInsert("b_catalog_disc_save_range", $arRange);
             $strSql = "insert into b_catalog_disc_save_range(" . $arInsert[0] . ") values(" . $arInsert[1] . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         unset($arRange);
     }
     if (!empty($arFields['GROUP_IDS'])) {
         $DB->Query("delete from b_catalog_disc_save_group where DISCOUNT_ID = " . $intID, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         foreach ($arFields['GROUP_IDS'] as &$intGroupID) {
             $strSql = "insert into b_catalog_disc_save_group(DISCOUNT_ID,GROUP_ID) values(" . $intID . "," . $intGroupID . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         unset($intGroupID);
     }
     $boolCalc = $boolCalc === true;
     if ($boolCalc) {
         CCatalogDiscountSave::UserDiscountCalc($intID, $arFields, false);
     }
     return $intID;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:39,代码来源:discount_save.php

示例3: Update

 public function Update($intID, $arFields, $boolCalc = false)
 {
     global $DB;
     global $stackCacheManager;
     global $USER;
     $intID = intval($intID);
     if ($intID <= 0) {
         return false;
     }
     $arFields1 = array();
     if (array_key_exists('CREATED_BY', $arFields)) {
         unset($arFields['CREATED_BY']);
     }
     if (array_key_exists('DATE_CREATE', $arFields)) {
         unset($arFields['DATE_CREATE']);
     }
     if (array_key_exists('TIMESTAMP_X', $arFields)) {
         unset($arFields['TIMESTAMP_X']);
     }
     if (isset($USER) && $USER instanceof CUser && 'CUser' == get_class($USER)) {
         if (!array_key_exists('MODIFIED_BY', $arFields) || intval($arFields["MODIFIED_BY"]) <= 0) {
             $arFields["MODIFIED_BY"] = intval($USER->GetID());
         }
     }
     $arFields1['TIMESTAMP_X'] = $DB->GetNowFunction();
     if (!CCatalogDiscountSave::CheckFields('UPDATE', $arFields, $intID)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_catalog_discount", $arFields);
     if (!empty($strUpdate)) {
         foreach ($arFields1 as $key => $value) {
             if (strlen($strUpdate) > 0) {
                 $strUpdate .= ", ";
             }
             $strUpdate .= $key . "=" . $value . " ";
         }
         $strSql = "UPDATE b_catalog_discount SET " . $strUpdate . " WHERE ID = " . $intID . " AND TYPE = " . DISCOUNT_TYPE_SAVE;
         $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     }
     if (!empty($arFields['RANGES'])) {
         $DB->Query("delete from b_catalog_disc_save_range where DISCOUNT_ID = " . $intID, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         foreach ($arFields['RANGES'] as &$arRange) {
             $arRange['DISCOUNT_ID'] = $intID;
             $arInsert = $DB->PrepareInsert("b_catalog_disc_save_range", $arRange);
             $strSql = "INSERT INTO b_catalog_disc_save_range(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         if (isset($arRange)) {
             unset($arRange);
         }
     }
     if (!empty($arFields['GROUP_IDS'])) {
         $DB->Query("delete from b_catalog_disc_save_group where DISCOUNT_ID = " . $intID, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         foreach ($arFields['GROUP_IDS'] as &$intGroupID) {
             $strSql = "INSERT INTO b_catalog_disc_save_group(DISCOUNT_ID,GROUP_ID) VALUES(" . $intID . "," . $intGroupID . ")";
             $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
         if (isset($intGroupID)) {
             unset($intGroupID);
         }
     }
     $boolCalc = $boolCalc === true ? true : false;
     if ($boolCalc) {
         CCatalogDiscountSave::UserDiscountCalc($ID, $arFields, false);
     }
     return $intID;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:67,代码来源:discount_save.php


注:本文中的CCatalogDiscountSave::CheckFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。