本文整理汇总了PHP中CSaleOrder::GetFilterOperation方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::GetFilterOperation方法的具体用法?PHP CSaleOrder::GetFilterOperation怎么用?PHP CSaleOrder::GetFilterOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::GetFilterOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PrepareSql
//.........这里部分代码省略.........
}
$strSqlFrom .= $arFields[$val]["FROM"];
$arAlreadyJoined[] = $arFields[$val]["FROM"];
}
}
}
}
if (strlen($strSqlGroupBy) > 0) {
if (strlen($strSqlSelect) > 0) {
$strSqlSelect .= ", ";
}
$strSqlSelect .= "COUNT(%%_DISTINCT_%% " . $arFields[$arFieldsKeys[0]]["FIELD"] . ") as CNT";
} else {
$strSqlSelect = "%%_DISTINCT_%% " . $strSqlSelect;
}
}
// <-- SELECT
// WHERE -->
$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++) {
$vals = $arFilter[$filter_keys[$i]];
if (!is_array($vals)) {
$vals = array($vals);
} else {
$vals = array_values($vals);
}
$key = $filter_keys[$i];
$key_res = CSaleOrder::GetFilterOperation($key);
$key = $key_res["FIELD"];
$strNegative = $key_res["NEGATIVE"];
$strOperation = $key_res["OPERATION"];
$strOrNull = $key_res["OR_NULL"];
if (array_key_exists($key, $arFields)) {
$arSqlSearch_tmp = array();
if (count($vals) > 0) {
if ($strOperation == "IN") {
if (isset($arFields[$key]["WHERE"])) {
$arSqlSearch_tmp1 = call_user_func_array($arFields[$key]["WHERE"], array($vals, $key, $strOperation, $strNegative, $arFields[$key]["FIELD"], $arFields, $arFilter));
if ($arSqlSearch_tmp1 !== false) {
$arSqlSearch_tmp[] = $arSqlSearch_tmp1;
}
} else {
if ($arFields[$key]["TYPE"] == "int") {
array_walk($vals, create_function("&\$item", "\$item=IntVal(\$item);"));
$vals = array_unique($vals);
$val = implode(",", $vals);
if (count($vals) <= 0) {
$arSqlSearch_tmp[] = "(1 = 2)";
} else {
$arSqlSearch_tmp[] = ($strNegative == "Y" ? " NOT " : "") . "(" . $arFields[$key]["FIELD"] . " IN (" . $val . "))";
}
} elseif ($arFields[$key]["TYPE"] == "double") {
array_walk($vals, create_function("&\$item", "\$item=DoubleVal(\$item);"));
$vals = array_unique($vals);
$val = implode(",", $vals);
if (count($vals) <= 0) {
$arSqlSearch_tmp[] = "(1 = 2)";
} else {
$arSqlSearch_tmp[] = ($strNegative == "Y" ? " NOT " : "") . "(" . $arFields[$key]["FIELD"] . " " . $strOperation . " (" . $val . "))";
}