當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CPrice::ReCountForBase方法代碼示例

本文整理匯總了PHP中CPrice::ReCountForBase方法的典型用法代碼示例。如果您正苦於以下問題:PHP CPrice::ReCountForBase方法的具體用法?PHP CPrice::ReCountForBase怎麽用?PHP CPrice::ReCountForBase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CPrice的用法示例。


在下文中一共展示了CPrice::ReCountForBase方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Add

 function Add($arFields, $boolRecalc = false)
 {
     global $DB;
     if (!CPrice::CheckFields("ADD", $arFields, 0)) {
         return false;
     }
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true ? true : false;
     $events = GetModuleEvents("catalog", "OnBeforePriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array(&$arFields));
     }
     if (!empty($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
     }
     $arInsert = $DB->PrepareInsert("b_catalog_price", $arFields);
     $strSql = "INSERT INTO b_catalog_price(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = IntVal($DB->LastID());
     if ($ID > 0 && $boolBase == true) {
         CPrice::ReCountForBase($arFields);
     }
     $events = GetModuleEvents("catalog", "OnPriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     // strange copy-paste bug
     $events = GetModuleEvents("sale", "OnPriceAdd");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:33,代碼來源:price.php

示例2: Add

 function Add($arFields, $boolRecalc = false)
 {
     global $DB;
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true;
     foreach (GetModuleEvents("catalog", "OnBeforePriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arFields));
     }
     if (!CPrice::CheckFields("ADD", $arFields, 0)) {
         return false;
     }
     if (isset($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
         if (!$boolBase && $arFields['EXTRA_ID'] <= 0) {
             return false;
         }
     }
     $arInsert = $DB->PrepareInsert("b_catalog_price", $arFields);
     $strSql = "INSERT INTO b_catalog_price(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = (int) $DB->LastID();
     if ($ID > 0 && $boolBase) {
         CPrice::ReCountForBase($arFields);
     }
     foreach (GetModuleEvents("catalog", "OnPriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     // strange copy-paste bug
     foreach (GetModuleEvents("sale", "OnPriceAdd", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:33,代碼來源:price.php

示例3: Update

 function Update($ID, $arFields, $boolRecalc = false)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         return False;
     }
     if (!CPrice::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $boolBase = false;
     $arFields['RECALC'] = $boolRecalc === true ? true : false;
     $db_events = GetModuleEvents("catalog", "OnBeforePriceUpdate");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
             return false;
         }
     }
     if (!empty($arFields['RECALC']) && $arFields['RECALC'] === true) {
         CPrice::ReCountFromBase($arFields, $boolBase);
     }
     $strUpdate = $DB->PrepareUpdate("b_catalog_price", $arFields);
     $strSql = "UPDATE b_catalog_price SET " . $strUpdate . " WHERE ID = " . $ID . " ";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($boolBase == true) {
         CPrice::ReCountForBase($arFields);
     }
     $events = GetModuleEvents("catalog", "OnPriceUpdate");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID, $arFields));
     }
     return $ID;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:33,代碼來源:price.php

示例4: Update

	function Update($ID, $arFields,$boolRecalc = false)
	{
		global $DB;

		$ID = intval($ID);
		if ($ID <= 0)
			return false;

		$boolBase = false;
		$arFields['RECALC'] = ($boolRecalc === true ? true : false);

		foreach (GetModuleEvents("catalog", "OnBeforePriceUpdate", true) as $arEvent)
		{
			if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields))===false)
				return false;
		}

		if (!CPrice::CheckFields("UPDATE", $arFields, $ID))
			return false;

		if (isset($arFields['RECALC']) && $arFields['RECALC'] === true)
		{
			CPrice::ReCountFromBase($arFields, $boolBase);
			if (!$boolBase && 0 >= $arFields['EXTRA_ID'])
			{
				return false;
			}
		}

		$strUpdate = $DB->PrepareUpdate("b_catalog_price", $arFields);
		if (!empty($strUpdate))
		{
			$strSql = "UPDATE b_catalog_price SET ".$strUpdate." WHERE ID = ".$ID;
			$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		}

		if ($boolBase)
		{
			CPrice::ReCountForBase($arFields);
		}

		foreach (GetModuleEvents("catalog", "OnPriceUpdate", true) as $arEvent)
		{
			ExecuteModuleEventEx($arEvent, array($ID, $arFields));
		}

		return $ID;
	}
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:48,代碼來源:price.php


注:本文中的CPrice::ReCountForBase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。