当前位置: 首页>>代码示例>>PHP>>正文


PHP CIBlock::FilterCreateEx方法代码示例

本文整理汇总了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))";
                 }
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:iblockelement.php

示例2: FilterCreate

 public static function FilterCreate($field_name, $values, $type, $cOperationType = false, $bSkipEmpty = true)
 {
     return CIBlock::FilterCreateEx($field_name, $values, $type, $bFullJoin, $cOperationType, $bSkipEmpty);
 }
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:4,代码来源:iblock.php


注:本文中的CIBlock::FilterCreateEx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。