当前位置: 首页>>代码示例>>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;未经允许,请勿转载。