本文整理汇总了PHP中CSaleDeliveryHandler::__sortList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleDeliveryHandler::__sortList方法的具体用法?PHP CSaleDeliveryHandler::__sortList怎么用?PHP CSaleDeliveryHandler::__sortList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleDeliveryHandler
的用法示例。
在下文中一共展示了CSaleDeliveryHandler::__sortList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetList
//.........这里部分代码省略.........
}
}
$bAllSite = false;
if ($arFilter["SITE_ID"] == "ALL") {
$bAllSite = true;
unset($arFilter["SITE_ID"]);
}
if ($arFilter["ACTIVE"] == "ALL") {
unset($arFilter["ACTIVE"]);
}
$arWhere = array();
$strWhere = "";
$arFilterKeys = array_keys($arFilter);
foreach ($arFilter as $key => $value) {
$match_value_set = in_array($key . "_EXACT_MATCH", $arFilterKeys) ? true : false;
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $match_value_set ? "Y" : "N";
$key = ToUpper($key);
switch ($key) {
// SITE_ID is unavailable for extended sorting! only direct selection; It's needed for after-select filtration.
case "SITE_ID":
if (strlen($value) > 0) {
//$arWhere[] = GetFilterQuery("LID", $value, $match);
$arWhere[] = "LID='" . $DB->ForSql($value) . "' OR LID='' OR LID IS NULL";
}
break;
case "ACTIVE":
if (strlen($value) > 0) {
$arWhere[] = "ACTIVE='" . ($value == 'N' ? 'N' : 'Y') . "'";
}
break;
case "SID":
case "ID":
if (strlen($value) > 0) {
$arWhere[] = GetFilterQuery("HID", $DB->ForSql($value), $match);
}
break;
case "HANDLER":
case "PATH":
if (strlen($value) > 0) {
$arWhere[] = GetFilterQuery("HANDLER", $DB->ForSql($value), $match);
}
}
}
$strWhere = GetFilterSqlSearch($arWhere);
$query = "\nSELECT HID AS SID\nFROM b_sale_delivery_handler\nWHERE\n" . $strWhere . "\n";
if (count($arSort) > 0) {
$query .= "ORDER BY ";
$bFirst = true;
foreach ($arSort as $SORT => $SORT_DIR) {
if ($bFirst) {
$bFirst = false;
} else {
$query .= ", ";
}
$query .= $SORT . " " . $SORT_DIR;
}
}
$dbRes = $DB->Query($query);
$arLoadedHandlers = array();
$arLoadedHandlersMap = array();
while ($arRes = $dbRes->Fetch()) {
$arLoadedHandlersMap[$arRes["SID"]] = $arRes;
}
$arHandlersList = CSaleDeliveryHandler::__getRegisteredHandlers();
if (is_array($arHandlersList)) {
foreach ($arHandlersList as $key => $arHandler) {
if (is_array($arLoadedHandlersMap) && !array_key_exists($arHandler["SID"], $arLoadedHandlersMap)) {
unset($arHandlersList[$key]);
}
}
$arHandlersList = array_values($arHandlersList);
$arHandlersList = CSaleDeliveryHandler::__getHandlersData($arHandlersList);
if ($arFilter["SITE_ID"] != "ALL" && is_array($arHandlersList)) {
foreach ($arHandlersList as $key => $arHandler) {
if (strlen($arHandler['LID']) > 0 && $arHandler['LID'] != $arFilter["SITE_ID"]) {
unset($arHandlersList[$key]);
}
}
}
if (is_array($arFilter["COMPABILITY"]) && is_array($arHandlersList)) {
foreach ($arHandlersList as $key => $arHandler) {
$arProfiles = CSaleDeliveryHandler::GetHandlerCompability($arFilter["COMPABILITY"], $arHandler);
if (!is_array($arProfiles) || count($arProfiles) <= 0) {
unset($arHandlersList[$key]);
} else {
$arHandlersList[$key]["PROFILES"] = $arProfiles;
}
}
}
CSaleDeliveryHandler::__sortList($arHandlersList, $arSort);
}
$dbHandlers = new CDBResult();
if (is_array($arHandlersList)) {
reset($arHandlersList);
$dbHandlers->InitFromArray($arHandlersList);
} else {
$dbHandlers->InitFromArray(array());
}
return $dbHandlers;
}