本文整理汇总了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;
}
}
示例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;
}