本文整理汇总了PHP中CIBlockElement::MkPropertyOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::MkPropertyOrder方法的具体用法?PHP CIBlockElement::MkPropertyOrder怎么用?PHP CIBlockElement::MkPropertyOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::MkPropertyOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PrepareGetList
//.........这里部分代码省略.........
$arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE", $order, "desc");
} elseif ($by == "ACTIVE_FROM") {
$arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE_FROM", $order, "desc");
} elseif ($by == "ACTIVE_TO") {
$arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE_TO", $order, "desc");
} elseif ($by == "SORT") {
$arSqlOrder[$by] = CIBlock::_Order("BE.SORT", $order, "desc");
} elseif ($by == "IBLOCK_SECTION_ID") {
$arSqlOrder[$by] = CIBlock::_Order("BE.IBLOCK_SECTION_ID", $order, "desc");
} elseif ($by == "SHOW_COUNTER") {
$arSqlOrder[$by] = CIBlock::_Order("BE.SHOW_COUNTER", $order, "desc");
} elseif ($by == "SHOW_COUNTER_START") {
$arSqlOrder[$by] = CIBlock::_Order("BE.SHOW_COUNTER_START", $order, "desc");
} elseif ($by == "RAND") {
$arSqlOrder[$by] = CIBlockElement::GetRandFunction(true);
} elseif ($by == "SHOWS") {
$arSqlOrder[$by] = CIBlock::_Order(CIBlockElement::GetShowedFunction(), $order, "desc", false);
} elseif ($by == "HAS_PREVIEW_PICTURE") {
$arSqlOrder[$by] = CIBlock::_Order(CIBlock::_NotEmpty("BE.PREVIEW_PICTURE"), $order, "desc", false);
} elseif ($by == "HAS_DETAIL_PICTURE") {
$arSqlOrder[$by] = CIBlock::_Order(CIBlock::_NotEmpty("BE.DETAIL_PICTURE"), $order, "desc", false);
} elseif ($by == "RATING_TOTAL_VALUE") {
$arSqlOrder[$by] = CIBlock::_Order("RV.TOTAL_VALUE", $order, "desc");
$arJoinProps["RV"] = true;
} elseif ($by == "CNT") {
if (is_array($arGroupBy) && count($arGroupBy) > 0) {
$arSqlOrder[$by] = " CNT " . $order . " ";
}
} elseif (substr($by, 0, 9) == "PROPERTY_") {
$propID = strtoupper(substr($by_orig, 9));
if (preg_match("/^([^.]+)\\.([^.]+)\$/", $propID, $arMatch)) {
$db_prop = CIBlockProperty::GetPropertyArray($arMatch[1], CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"]));
if (is_array($db_prop) && $db_prop["PROPERTY_TYPE"] == "E") {
CIBlockElement::MkPropertyOrder($arMatch, $order, false, $db_prop, $arJoinProps, $arSqlOrder);
}
} else {
if ($db_prop = CIBlockProperty::GetPropertyArray($propID, CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"]))) {
CIBlockElement::MkPropertyOrder($by, $order, false, $db_prop, $arJoinProps, $arSqlOrder);
}
}
} elseif (substr($by, 0, 13) == "PROPERTYSORT_") {
$propID = strtoupper(substr($by_orig, 13));
if (preg_match("/^([^.]+)\\.([^.]+)\$/", $propID, $arMatch)) {
$db_prop = CIBlockProperty::GetPropertyArray($arMatch[1], CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"]));
if (is_array($db_prop) && $db_prop["PROPERTY_TYPE"] == "E") {
CIBlockElement::MkPropertyOrder($arMatch, $order, true, $db_prop, $arJoinProps, $arSqlOrder);
}
} else {
if ($db_prop = CIBlockProperty::GetPropertyArray($propID, CIBlock::_MergeIBArrays($arFilter["IBLOCK_ID"], $arFilter["IBLOCK_CODE"]))) {
CIBlockElement::MkPropertyOrder($by, $order, true, $db_prop, $arJoinProps, $arSqlOrder);
}
}
} else {
$by = "ID";
if (!array_key_exists($by, $arSqlOrder)) {
$arSqlOrder[$by] = CIBLock::_Order("BE.ID", $order, "desc");
}
}
//Check if have to add select field in order to correctly sort
if (is_array($arSqlOrder[$by])) {
if (is_array($arGroupBy) && count($arGroupBy) > 0) {
$arGroupBy[] = $arSqlOrder[$by][1];
} else {
$arSelectFields[] = $arSqlOrder[$by][1];
}
// COLUMN ALIAS COLUMN EXPRESSION