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


PHP CSaleLocation::getDenormalizedLocationList方法代碼示例

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


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

示例1: GetLocationList

	function GetLocationList($arFilter = Array())
	{
		if(CSaleLocation::isLocationProMigrated())
		{
			try
			{
				return CSaleLocation::getDenormalizedLocationList(self::CONN_ENTITY_NAME, $arFilter);
			}
			catch(Exception $e)
			{
				return new DB\ArrayResult(array());
			}
		}
		else
		{

			global $DB;
			$arSqlSearch = Array();

			if(!is_array($arFilter))
				$filter_keys = Array();
			else
				$filter_keys = array_keys($arFilter);

			$countFilterKey = count($filter_keys);
			for($i=0; $i < $countFilterKey; $i++)
			{
				$val = $DB->ForSql($arFilter[$filter_keys[$i]]);
				if (strlen($val)<=0) continue;

				$key = $filter_keys[$i];
				if ($key[0]=="!")
				{
					$key = substr($key, 1);
					$bInvert = true;
				}
				else
					$bInvert = false;

				switch(ToUpper($key))
				{
				case "DELIVERY_ID":
					$arSqlSearch[] = "DL.DELIVERY_ID ".($bInvert?"<>":"=")." ".IntVal($val)." ";
					break;
				case "LOCATION_ID":
					$arSqlSearch[] = "DL.LOCATION_CODE ".($bInvert?"<>":"=")." ".IntVal($val)." ";
					break;
				case "LOCATION_TYPE":
					$arSqlSearch[] = "DL.LOCATION_TYPE ".($bInvert?"<>":"=")." '".$val."' ";
					break;
				}
			}

			$strSqlSearch = "";
			$countSqlSearch = count($arSqlSearch);
			for($i=0; $i < $countSqlSearch; $i++)
			{
				$strSqlSearch .= " AND ";
				$strSqlSearch .= " (".$arSqlSearch[$i].") ";
			}

			$strSql =
				"SELECT DL.DELIVERY_ID, DL.LOCATION_CODE as LOCATION_ID, DL.LOCATION_TYPE ".
				"FROM b_sale_delivery2location DL ".
				"WHERE 1 = 1 ".
				"	".$strSqlSearch." ";

			$db_res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
			return $db_res;

		}
	}
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:72,代碼來源:delivery.php

示例2: GetLocationList

 /**
  * @param array $arFilter
  * @return bool|CDBResult
  * @deprecated
  */
 function GetLocationList($arFilter = array())
 {
     $deliveryId = 0;
     if (!empty($arFilter['DELIVERY_ID'])) {
         $deliveryId = $arFilter['DELIVERY_ID'];
         $arFilter['DELIVERY_ID'] = \Bitrix\Sale\Delivery\Services\Table::getIdByCode($deliveryId);
     }
     try {
         $locations = array();
         $res = CSaleLocation::getDenormalizedLocationList(self::CONN_ENTITY_NAME, $arFilter);
         while ($loc = $res->Fetch()) {
             $loc['DELIVERY_ID'] = $deliveryId;
             $locations[] = $loc;
         }
     } catch (Exception $e) {
         $locations = array();
     }
     $dbResult = new CDBResult();
     $dbResult->InitFromArray($locations);
     return $dbResult;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:26,代碼來源:delivery.php


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