本文整理汇总了PHP中CSaleOrderPropsValue::addPropertyValueField方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderPropsValue::addPropertyValueField方法的具体用法?PHP CSaleOrderPropsValue::addPropertyValueField怎么用?PHP CSaleOrderPropsValue::addPropertyValueField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderPropsValue
的用法示例。
在下文中一共展示了CSaleOrderPropsValue::addPropertyValueField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetList
function GetList($arOrder = array(), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
{
global $DB;
if (!is_array($arOrder) && !is_array($arFilter)) {
$arOrder = strval($arOrder);
$arFilter = strval($arFilter);
if (strlen($arOrder) > 0 && strlen($arFilter) > 0) {
$arOrder = array($arOrder => $arFilter);
} else {
$arOrder = array();
}
if (is_array($arGroupBy)) {
$arFilter = $arGroupBy;
} else {
$arFilter = array();
}
$arGroupBy = false;
$arSelectFields = array("ID", "ORDER_ID", "ORDER_PROPS_ID", "NAME", "VALUE", "CODE");
}
if (count($arSelectFields) <= 0) {
$arSelectFields = array("ID", "ORDER_ID", "ORDER_PROPS_ID", "NAME", "VALUE", "CODE");
}
// FIELDS -->
$arFields = array("ID" => array("FIELD" => "V.ID", "TYPE" => "int"), "ORDER_ID" => array("FIELD" => "V.ORDER_ID", "TYPE" => "int"), "ORDER_PROPS_ID" => array("FIELD" => "V.ORDER_PROPS_ID", "TYPE" => "int"), "NAME" => array("FIELD" => "V.NAME", "TYPE" => "string"), "CODE" => array("FIELD" => "V.CODE", "TYPE" => "string"), "PROP_ID" => array("FIELD" => "P.ID", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_PERSON_TYPE_ID" => array("FIELD" => "P.PERSON_TYPE_ID", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_NAME" => array("FIELD" => "P.NAME", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_TYPE" => array("FIELD" => "P.TYPE", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_REQUIED" => array("FIELD" => "P.REQUIED", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_DEFAULT_VALUE" => array("FIELD" => "P.DEFAULT_VALUE", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_SORT" => array("FIELD" => "P.SORT", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_USER_PROPS" => array("FIELD" => "P.USER_PROPS", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_LOCATION" => array("FIELD" => "P.IS_LOCATION", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_PROPS_GROUP_ID" => array("FIELD" => "P.PROPS_GROUP_ID", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_SIZE1" => array("FIELD" => "P.SIZE1", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_SIZE2" => array("FIELD" => "P.SIZE2", "TYPE" => "int", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_DESCRIPTION" => array("FIELD" => "P.DESCRIPTION", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_EMAIL" => array("FIELD" => "P.IS_EMAIL", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_PROFILE_NAME" => array("FIELD" => "P.IS_PROFILE_NAME", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_PAYER" => array("FIELD" => "P.IS_PAYER", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_LOCATION4TAX" => array("FIELD" => "P.IS_LOCATION4TAX", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_IS_ZIP" => array("FIELD" => "P.IS_ZIP", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_CODE" => array("FIELD" => "P.CODE", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_ACTIVE" => array("FIELD" => "P.ACTIVE", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"), "PROP_UTIL" => array("FIELD" => "P.UTIL", "TYPE" => "char", "FROM" => "LEFT JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID)"));
// <-- FIELDS
CSaleOrderPropsValue::addPropertyValueField('V', $arFields, $arSelectFields);
$arSqls = CSaleOrder::PrepareSql($arFields, $arOrder, $arFilter, $arGroupBy, $arSelectFields);
$arSqls["SELECT"] = str_replace("%%_DISTINCT_%%", "DISTINCT", $arSqls["SELECT"]);
if (is_array($arGroupBy) && count($arGroupBy) == 0) {
$strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_sale_order_props_value V " . "\t" . $arSqls["FROM"] . " ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql .= "WHERE " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
//echo "!1!=".htmlspecialcharsbx($strSql)."<br>";
$dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($arRes = $dbRes->Fetch()) {
return $arRes["CNT"];
} else {
return False;
}
}
$strSql = "SELECT " . $arSqls["SELECT"] . " " . "FROM b_sale_order_props_value V " . "\t" . $arSqls["FROM"] . " ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql .= "WHERE " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
if (strlen($arSqls["ORDERBY"]) > 0) {
$strSql .= "ORDER BY " . $arSqls["ORDERBY"] . " ";
}
if (is_array($arNavStartParams) && IntVal($arNavStartParams["nTopCount"]) <= 0) {
$strSql_tmp = "SELECT COUNT('x') as CNT " . "FROM b_sale_order_props_value V " . "\t" . $arSqls["FROM"] . " ";
if (strlen($arSqls["WHERE"]) > 0) {
$strSql_tmp .= "WHERE " . $arSqls["WHERE"] . " ";
}
if (strlen($arSqls["GROUPBY"]) > 0) {
$strSql_tmp .= "GROUP BY " . $arSqls["GROUPBY"] . " ";
}
//echo "!2.1!=".htmlspecialcharsbx($strSql_tmp)."<br>";
$dbRes = $DB->Query($strSql_tmp, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$cnt = 0;
if (strlen($arSqls["GROUPBY"]) <= 0) {
if ($arRes = $dbRes->Fetch()) {
$cnt = $arRes["CNT"];
}
} else {
$cnt = $dbRes->SelectedRowsCount();
}
$dbRes = new CDBResult();
//echo "!2.2!=".htmlspecialcharsbx($strSql)."<br>";
$dbRes->NavQuery($strSql, $cnt, $arNavStartParams);
} else {
if (is_array($arNavStartParams) && IntVal($arNavStartParams["nTopCount"]) > 0) {
$strSql .= "LIMIT " . IntVal($arNavStartParams["nTopCount"]);
}
//echo "!3!=".htmlspecialcharsbx($strSql)."<br>";
$dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
return $dbRes;
}