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


PHP CCatalogDiscountSave::GetList方法代碼示例

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


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

示例1: array

$arPeriodTypeList = CCatalogDiscountSave::GetPeriodTypeList(true);

$arUserList = array();
$arUserID = array();
$strNameFormat = CSite::GetNameFormat(true);

$arNavParams = (isset($_REQUEST["mode"]) && "excel" == $_REQUEST["mode"]
	? false
	: array("nPageSize" => CAdminResult::GetNavSize($sTableID))
);

$obDiscSave = new CCatalogDiscountSave();
$rsDiscSaves = $obDiscSave->GetList(
	array($by=>$order),
	$arFilter,
	false,
	$arNavParams,
	$arSelectFields
);

$rsDiscSaves = new CAdminResult($rsDiscSaves, $sTableID);

$rsDiscSaves->NavStart();

$lAdmin->NavText($rsDiscSaves->GetNavPrint(GetMessage("BT_CAT_DISC_SAVE_ADM_DISCOUNTS")));

$arRows = array();

while($arRes = $rsDiscSaves->Fetch())
{
	$arRes['ID'] = (int)$arRes['ID'];
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:31,代碼來源:cat_discsave_admin.php

示例2: GetDiscount

 public function GetDiscount($arParams = array(), $getAll = false)
 {
     global $DB, $USER;
     $adminSection = defined('ADMIN_SECTION') && ADMIN_SECTION === true;
     $arResult = array();
     if (!CCatalog::IsUserExists() || !$USER->IsAuthorized() || !self::IsEnabled()) {
         return $arResult;
     }
     foreach (GetModuleEvents("catalog", "OnGetDiscountSave", true) as $arEvent) {
         $mxResult = ExecuteModuleEventEx($arEvent, $arParams);
         if ($mxResult !== true) {
             return $mxResult;
         }
     }
     if (empty($arParams) || !is_array($arParams)) {
         return $arResult;
     }
     $intUserID = 0;
     $arUserGroups = array();
     $strSiteID = false;
     if (isset($arParams['USER_ID'])) {
         $intUserID = (int) $arParams['USER_ID'];
     }
     if (isset($arParams['USER_GROUPS'])) {
         $arUserGroups = $arParams['USER_GROUPS'];
     }
     if (isset($arParams['SITE_ID'])) {
         $strSiteID = $arParams['SITE_ID'];
     }
     if (self::GetDiscountUserID() > 0) {
         $intUserID = (int) self::GetDiscountUserID();
         $arUserGroups = array();
     }
     if ($intUserID <= 0 && !$adminSection) {
         $intUserID = (int) $USER->GetID();
         $arUserGroups = array();
     }
     if (empty($arUserGroups)) {
         if (!isset(self::$userGroups[$intUserID])) {
             self::$userGroups[$intUserID] = $USER->GetUserGroup($intUserID);
         }
         $arUserGroups = self::$userGroups[$intUserID];
     }
     if (empty($arUserGroups) || !is_array($arUserGroups) || $intUserID <= 0) {
         return $arResult;
     }
     $key = array_search(2, $arUserGroups);
     if ($key !== false) {
         unset($arUserGroups[$key]);
     }
     if (empty($arUserGroups)) {
         return $arResult;
     }
     Main\Type\Collection::normalizeArrayValuesByInt($arUserGroups, true);
     if (empty($arUserGroups)) {
         return $arResult;
     }
     if ($strSiteID === false) {
         $strSiteID = SITE_ID;
     }
     $cacheKey = md5('U' . implode('_', $arUserGroups));
     if (!isset(self::$discountFilterCache[$cacheKey])) {
         self::$discountFilterCache[$cacheKey] = CCatalogDiscountSave::__GetDiscountIDByGroup($arUserGroups);
     }
     if (empty(self::$discountFilterCache[$cacheKey])) {
         return $arResult;
     }
     $arCurrentDiscountID = self::$discountFilterCache[$cacheKey];
     if (isset($arParams['ID'])) {
         Main\Type\Collection::normalizeArrayValuesByInt($arUserGroups, true);
         if (!empty($arParams['ID'])) {
             $arCurrentDiscountID = array_intersect($arCurrentDiscountID, $arParams['ID']);
         }
     }
     if (!empty($arCurrentDiscountID)) {
         $getAll = $getAll === true;
         $intCurrentTime = getmicrotime();
         $strDate = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), $intCurrentTime);
         $arFilter = array('ID' => $arCurrentDiscountID, 'SITE_ID' => $strSiteID, 'TYPE' => self::ENTITY_ID, 'ACTIVE' => 'Y', '+<=ACTIVE_FROM' => $strDate, '+>=ACTIVE_TO' => $strDate);
         CTimeZone::Disable();
         $rsDiscSaves = CCatalogDiscountSave::GetList(array(), $arFilter);
         CTimeZone::Enable();
         while ($arDiscSave = $rsDiscSaves->Fetch()) {
             $arDiscSave['ACTION_SIZE'] = (int) $arDiscSave['ACTION_SIZE'];
             $arDiscSave['COUNT_SIZE'] = (int) $arDiscSave['COUNT_SIZE'];
             $arDiscSave['ACTIVE_FROM_UT'] = false;
             $arDiscSave['ACTIVE_TO_UT'] = false;
             $arDiscSave['COUNT_FROM_UT'] = false;
             $arDiscSave['COUNT_TO_UT'] = false;
             $arDiscSave['TYPE'] = (int) $arDiscSave['TYPE'];
             $arDiscSave['MODULE_ID'] = 'catalog';
             $strCountPeriod = self::COUNT_TIME_ALL;
             $strActionPeriod = self::ACTION_TIME_ALL;
             $arCountPeriodBack = array();
             $arActionPeriodBack = array();
             $arActionPeriod = array();
             $arStartDate = false;
             $arOldOrderSumm = false;
             $arOrderSumm = false;
             $boolPeriodInsert = true;
//.........這裏部分代碼省略.........
開發者ID:Satariall,項目名稱:izurit,代碼行數:101,代碼來源:discount_save.php

示例3: GetDiscount

 public function GetDiscount($arParams = array())
 {
     global $DB;
     global $USER;
     $arResult = array();
     if (!(isset($USER) && $USER instanceof CUser && 'CUser' == get_class($USER))) {
         return $arResult;
     }
     if (!$USER->IsAuthorized()) {
         return $arResult;
     }
     if (!self::IsEnabled()) {
         return $arResult;
     }
     foreach (GetModuleEvents("catalog", "OnGetDiscountSave", true) as $arEvent) {
         $mxResult = ExecuteModuleEventEx($arEvent, $arParams);
         if (true !== $mxResult) {
             return $mxResult;
         }
     }
     if (!is_array($arParams) || empty($arParams)) {
         return $arResult;
     }
     $intUserID = 0;
     $arUserGroups = array();
     $strSiteID = false;
     if (isset($arParams['USER_ID'])) {
         $intUserID = $arParams['USER_ID'];
     }
     if (isset($arParams['USER_GROUPS'])) {
         $arUserGroups = $arParams['USER_GROUPS'];
     }
     if (isset($arParams['SITE_ID'])) {
         $strSiteID = $arParams['SITE_ID'];
     }
     if (0 < self::GetDiscountUserID()) {
         $intUserID = self::GetDiscountUserID();
         $arUserGroups = $USER->GetUserGroup($intUserID);
     } else {
         $intUserID = intval($intUserID);
         if (0 >= $intUserID) {
             $intUserID = $USER->GetID();
             $arUserGroups = $USER->GetUserGroupArray();
         } else {
             if (empty($arUserGroups)) {
                 $arUserGroups = $USER->GetUserGroup($intUserID);
             }
         }
     }
     if (!is_array($arUserGroups) || empty($arUserGroups) || 0 >= $intUserID) {
         return $arResult;
     }
     $key = array_search(2, $arUserGroups);
     if (false !== $key) {
         unset($arUserGroups[$key]);
     }
     if (empty($arUserGroups)) {
         return $arResult;
     }
     if ($strSiteID === false) {
         $strSiteID = SITE_ID;
     }
     $arCurrentDiscountID = CCatalogDiscountSave::__GetDiscountIDByGroup($arUserGroups);
     if (!empty($arCurrentDiscountID)) {
         $intCurrentTime = getmicrotime();
         $arFilter = array("ID" => $arCurrentDiscountID, 'SITE_ID' => $strSiteID, "TYPE" => DISCOUNT_TYPE_SAVE, 'ACTIVE' => 'Y', "+<=ACTIVE_FROM" => date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), $intCurrentTime), "+>=ACTIVE_TO" => date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), $intCurrentTime));
         $rsDiscSaves = CCatalogDiscountSave::GetList(array(), $arFilter);
         while ($arDiscSave = $rsDiscSaves->Fetch()) {
             $arDiscSave['ACTION_SIZE'] = intval($arDiscSave['ACTION_SIZE']);
             $arDiscSave['COUNT_SIZE'] = intval($arDiscSave['COUNT_SIZE']);
             $arDiscSave['ACTIVE_FROM_UT'] = false;
             $arDiscSave['ACTIVE_TO_UT'] = false;
             $arDiscSave['COUNT_FROM_UT'] = false;
             $arDiscSave['COUNT_TO_UT'] = false;
             $strCountPeriod = 'U';
             $strActionPeriod = 'U';
             $arCountPeriodBack = array();
             $arActionPeriodBack = array();
             $arActionPeriod = array();
             $arStartDate = false;
             $arOldOrderSumm = false;
             $arOrderSumm = false;
             $boolPeriodInsert = true;
             $intCountTime = $intCurrentTime;
             $arOrderFilter = array("USER_ID" => $intUserID, "LID" => $arDiscSave['SITE_ID'], "PAYED" => "Y", "CANCELED" => "N");
             $arOldOrderFilter = $arOrderFilter;
             if (!empty($arDiscSave['ACTIVE_FROM']) || !empty($arDiscSave['ACTIVE_TO'])) {
                 $strActionPeriod = 'D';
                 if (!empty($arDiscSave['ACTIVE_FROM'])) {
                     $arDiscSave['ACTIVE_FROM_UT'] = MakeTimeStamp($arDiscSave['ACTIVE_FROM']);
                 }
                 if (!empty($arDiscSave['ACTIVE_TO'])) {
                     $arDiscSave['ACTIVE_TO_UT'] = MakeTimeStamp($arDiscSave['ACTIVE_TO']);
                 }
             } elseif (0 < $arDiscSave['ACTION_SIZE'] && in_array($arDiscSave['ACTION_TYPE'], array('D', 'M', 'Y'))) {
                 $strActionPeriod = 'P';
                 $arActionPeriodBack = CCatalogDiscountSave::__GetTimeStampArray($arDiscSave['ACTION_SIZE'], $arDiscSave['ACTION_TYPE']);
                 $arActionPeriod = CCatalogDiscountSave::__GetTimeStampArray($arDiscSave['ACTION_SIZE'], $arDiscSave['ACTION_TYPE'], true);
             }
             if (!empty($arDiscSave['COUNT_FROM']) || !empty($arDiscSave['COUNT_TO'])) {
//.........這裏部分代碼省略.........
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:101,代碼來源:discount_save.php


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