本文整理汇总了PHP中CIBlock::FilterCreateEx方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::FilterCreateEx方法的具体用法?PHP CIBlock::FilterCreateEx怎么用?PHP CIBlock::FilterCreateEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::FilterCreateEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MkPropertyFilter
function MkPropertyFilter($res, $cOperationType, $propVAL, $db_prop, &$arJoinProps, &$arSqlSearch)
{
global $DB;
if ($res["OPERATION"] != "E") {
$cOperationType = $res["OPERATION"];
}
//Tables counters
if ($db_prop["VERSION"] == 2 && $db_prop["MULTIPLE"] == "N") {
if (!array_key_exists($db_prop["IBLOCK_ID"], $arJoinProps["FPS"])) {
$iPropCnt = count($arJoinProps["FPS"]);
} else {
$iPropCnt = $arJoinProps["FPS"][$db_prop["IBLOCK_ID"]];
}
} else {
if (!array_key_exists($db_prop["ID"], $arJoinProps["FPV"])) {
$iPropCnt = count($arJoinProps["FPV"]);
} else {
$iPropCnt = $arJoinProps["FPV"][$db_prop["ID"]]["CNT"];
}
}
if (!is_array($res["FIELD"]) && substr(strtoupper($res["FIELD"]), -6) == '_VALUE') {
$bValueEnum = true;
} else {
$bValueEnum = false;
}
if ($db_prop["PROPERTY_TYPE"] == "L" && $bValueEnum) {
if (!array_key_exists($db_prop["ID"], $arJoinProps["FPEN"])) {
$iFpenCnt = count($arJoinProps["FPEN"]);
} else {
$iFpenCnt = $arJoinProps["FPEN"][$db_prop["ID"]]["CNT"];
}
} else {
$iFpenCnt = false;
}
if (is_array($res["FIELD"])) {
if (!array_key_exists($db_prop["ID"], $arJoinProps["BE"])) {
$iElCnt = count($arJoinProps["BE"]);
} else {
$iElCnt = $arJoinProps["BE"][$db_prop["ID"]]["CNT"];
}
} else {
$iElCnt = false;
}
$r = "";
if (is_array($res["FIELD"])) {
switch ($res["FIELD"][2] . "") {
case "ACTIVE":
case "DETAIL_TEXT_TYPE":
case "PREVIEW_TEXT_TYPE":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . "." . $res["FIELD"][2], $propVAL, "string_equal", $bFullJoinTmp, $cOperationType);
break;
case "EXTERNAL_ID":
$res["FIELD"][2] = "XML_ID";
case "NAME":
case "XML_ID":
case "TMP_ID":
case "DETAIL_TEXT":
case "SEARCHABLE_CONTENT":
case "PREVIEW_TEXT":
case "CODE":
case "TAGS":
case "WF_COMMENTS":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . "." . $res["FIELD"][2], $propVAL, "string", $bFullJoinTmp, $cOperationType);
break;
case "ID":
case "SHOW_COUNTER":
case "WF_PARENT_ELEMENT_ID":
case "WF_STATUS_ID":
case "SORT":
case "CREATED_BY":
case "PREVIEW_PICTURE":
case "DETAIL_PICTURE":
case "IBLOCK_ID":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . "." . $res["FIELD"][2], $propVAL, "number", $bFullJoinTmp, $cOperationType);
break;
case "TIMESTAMP_X":
case "DATE_CREATE":
case "SHOW_COUNTER_START":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . "." . $res["FIELD"][2], $propVAL, "date", $bFullJoinTmp, $cOperationType);
break;
case "DATE_ACTIVE_FROM":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . ".ACTIVE_FROM", $propVAL, "date", $bFullJoinTmp, $cOperationType);
break;
case "DATE_ACTIVE_TO":
$r = CIBlock::FilterCreateEx("BE" . $iElCnt . ".ACTIVE_TO", $propVAL, "date", $bFullJoinTmp, $cOperationType);
break;
case "ACTIVE_FROM":
if (strlen($propVAL) > 0) {
$r = "(BE" . $iElCnt . ".ACTIVE_FROM " . ($cOperationType == "N" ? "<" : ">=") . $DB->CharToDateFunction($DB->ForSql($propVAL), "FULL") . ($cOperationType == "N" ? "" : " OR BE" . $iElCnt . ".ACTIVE_FROM IS NULL") . ")";
}
break;
case "ACTIVE_TO":
if (strlen($propVAL) > 0) {
$r = "(BE" . $iElCnt . ".ACTIVE_TO " . ($cOperationType == "N" ? ">" : "<=") . $DB->CharToDateFunction($DB->ForSql($propVAL), "FULL") . ($cOperationType == "N" ? "" : " OR BE" . $iElCnt . ".ACTIVE_TO IS NULL") . ")";
}
break;
case "ACTIVE_DATE":
if (strlen($propVAL) > 0) {
$r = ($cOperationType == "N" ? " NOT" : "") . "((BE" . $iElCnt . ".ACTIVE_TO >= " . $DB->GetNowFunction() . " OR BE" . $iElCnt . ".ACTIVE_TO IS NULL) AND (BE" . $iElCnt . ".ACTIVE_FROM <= " . $DB->GetNowFunction() . " OR BE" . $iElCnt . ".ACTIVE_FROM IS NULL))";
}
//.........这里部分代码省略.........
示例2: FilterCreate
public static function FilterCreate($field_name, $values, $type, $cOperationType = false, $bSkipEmpty = true)
{
return CIBlock::FilterCreateEx($field_name, $values, $type, $bFullJoin, $cOperationType, $bSkipEmpty);
}