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


PHP CSaleOrderProps::GetByID方法代码示例

本文整理汇总了PHP中CSaleOrderProps::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderProps::GetByID方法的具体用法?PHP CSaleOrderProps::GetByID怎么用?PHP CSaleOrderProps::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSaleOrderProps的用法示例。


在下文中一共展示了CSaleOrderProps::GetByID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CheckFields

 public static function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     if ((is_set($arFields, "ORDER_ID") || $ACTION == "ADD") && IntVal($arFields["ORDER_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_ORDER_ID"), "EMPTY_ORDER_ID");
         return false;
     }
     if ((is_set($arFields, "ORDER_PROPS_ID") || $ACTION == "ADD") && IntVal($arFields["ORDER_PROPS_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_PROP_ID"), "EMPTY_ORDER_PROPS_ID");
         return false;
     }
     if (is_set($arFields, "ORDER_ID")) {
         if (!($arOrder = CSaleOrder::GetByID($arFields["ORDER_ID"]))) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_ID"], GetMessage("SKGOPV_NO_ORDER_ID")), "ERROR_NO_ORDER");
             return false;
         }
     }
     if (is_set($arFields, "ORDER_PROPS_ID")) {
         if (!($arOrder = CSaleOrderProps::GetByID($arFields["ORDER_PROPS_ID"]))) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_PROPS_ID"], GetMessage("SKGOPV_NO_PROP_ID")), "ERROR_NO_PROPERY");
             return false;
         }
         if (is_set($arFields, "ORDER_ID")) {
             $arFilter = array("ORDER_ID" => $arFields["ORDER_ID"], "ORDER_PROPS_ID" => $arFields["ORDER_PROPS_ID"]);
             if (IntVal($ID) > 0) {
                 $arFilter["!ID"] = $ID;
             }
             $dbP = CSaleOrderPropsValue::GetList(array(), $arFilter);
             if ($arP = $dbP->Fetch()) {
                 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_DUPLICATE_PROP_ID", array("#ID#" => $arFields["ORDER_PROPS_ID"], "#ORDER_ID#" => $arFields["ORDER_ID"])), "ERROR_DUPLICATE_PROP_ID");
                 return false;
             }
         }
     }
     return True;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:35,代码来源:order_props_values.php

示例2: translateLocationIDToCode

 protected static function translateLocationIDToCode($id, $orderPropId)
 {
     if (!CSaleLocation::isLocationProMigrated()) {
         return $id;
     }
     $prop = CSaleOrderProps::GetByID($orderPropId);
     if (isset($prop['TYPE']) && $prop['TYPE'] == 'LOCATION') {
         if ((string) $id === (string) intval($id)) {
             return CSaleLocation::tryTranslateIDToCode($id);
         }
     }
     return $id;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:order_user_props_value.php

示例3: AddOrderProperty

function AddOrderProperty($prop_id, $value, $order)
{
    if (!strlen($prop_id)) {
        return false;
    }
    if (CModule::IncludeModule('sale')) {
        if ($arOrderProps = CSaleOrderProps::GetByID($prop_id)) {
            $db_vals = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $order, 'ORDER_PROPS_ID' => $arOrderProps['ID']));
            if ($arVals = $db_vals->Fetch()) {
                return CSaleOrderPropsValue::Update($arVals['ID'], array('NAME' => $arVals['NAME'], 'CODE' => $arVals['CODE'], 'ORDER_PROPS_ID' => $arVals['ORDER_PROPS_ID'], 'ORDER_ID' => $arVals['ORDER_ID'], 'VALUE' => $value));
            } else {
                return CSaleOrderPropsValue::Add(array('NAME' => $arOrderProps['NAME'], 'CODE' => $arOrderProps['CODE'], 'ORDER_PROPS_ID' => $arOrderProps['ID'], 'ORDER_ID' => $order, 'VALUE' => $value));
            }
        }
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:16,代码来源:AddOrderProperty.php

示例4: CheckFields

 function CheckFields($ACTION, &$arFields, $ID = 0)
 {
     global $DB, $USER;
     if ((is_set($arFields, "VALUE") || $ACTION == "ADD") && strlen($arFields["VALUE"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_VAR"), "ERROR_NO_VALUE");
         return false;
     }
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_NAME"), "ERROR_NO_NAME");
         return false;
     }
     if ((is_set($arFields, "ORDER_PROPS_ID") || $ACTION == "ADD") && IntVal($arFields["ORDER_PROPS_ID"]) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPV_EMPTY_CODE"), "ERROR_NO_ORDER_PROPS_ID");
         return false;
     }
     if (is_set($arFields, "ORDER_PROPS_ID")) {
         if (!($arOrder = CSaleOrderProps::GetByID($arFields["ORDER_PROPS_ID"]))) {
             $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_PROPS_ID"], GetMessage("SKGOPV_NO_PROP")), "ERROR_NO_PROPERY");
             return false;
         }
     }
     return True;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:23,代码来源:order_props_variant.php

示例5: IncludeModuleLangFile

    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
ClearVars();
ClearVars("f_");
ClearVars("l_");
$ID = IntVal($ID);
$PERSON_TYPE_ID = IntVal($PERSON_TYPE_ID);
$arPersonTypeList = array();
$dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array());
while ($arPersonType = $dbPersonType->Fetch()) {
    $arPersonTypeList[$arPersonType["ID"]] = array("ID" => $arPersonType["ID"], "NAME" => htmlspecialcharsEx($arPersonType["NAME"]), "LID" => implode(", ", $arPersonType["LIDS"]));
}
if ($ID > 0 && ($arOrderProps = CSaleOrderProps::GetByID($ID))) {
    $PERSON_TYPE_ID = $arOrderProps["PERSON_TYPE_ID"];
} elseif ($PERSON_TYPE_ID > 0 && !empty($arPersonTypeList[$PERSON_TYPE_ID])) {
    $ID = 0;
} else {
    LocalRedirect("sale_order_props.php?lang=" . LANG . GetFilterParams("filter_", false));
}
$strError = "";
$bInitVars = false;
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && $saleModulePermissions == "W" && strlen($propeditmore) <= 0 && check_bitrix_sessid()) {
    $PERSON_TYPE_ID = IntVal($PERSON_TYPE_ID);
    if ($PERSON_TYPE_ID <= 0) {
        $strError .= GetMessage("ERROR_NO_PERS_TYPE") . "<br>";
    }
    $NAME = Trim($NAME);
    if (strlen($NAME) <= 0) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:order_props_edit.php

示例6: die

        // incorrect order
        if ($arFields === false || empty($arFields)) {
            die();
        }

        $LID = $arFields['LID'];
        $userId = $arFields['USER_ID'];

        if(isset($order['customer']['externalId']) && !is_null($order['customer']['externalId'])) {
            $userId = $order['customer']['externalId'];
        }

        $rsOrderProps = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $arFields['ID']));
        $arUpdateProps = array();
        while ($ar = $rsOrderProps->Fetch()) {
            $prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
            $arUpdateProps[ $ar['CODE'] ] = array('ID' => $ar['ID'], 'TYPE' => $prop['TYPE'], 'VALUE' => $ar['VALUE']);
        }

        $order['fio'] = trim(
            implode(
                ' ',
                array(
                    isset($order['lastName']) ? $order['lastName'] : '',
                    isset($order['firstName']) ? $order['firstName'] : '',
                    isset($order['patronymic']) ? $order['patronymic'] : '',
                )
            )
        );

        if (isset($order['delivery']['address']['city'])) {
开发者ID:Ksenobyte,项目名称:bitrix-module,代码行数:31,代码来源:history.php

示例7: translateLocationIDToCode

 public static function translateLocationIDToCode($id, $orderPropId)
 {
     $prop = CSaleOrderProps::GetByID($orderPropId);
     if (isset($prop['TYPE']) && $prop['TYPE'] == 'LOCATION') {
         return CSaleLocation::tryTranslateIDToCode($id);
     }
     return $id;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:8,代码来源:order_props_values.php

示例8: orderHistory


//.........这里部分代码省略.........
             if (!isset($order['externalId'])) {
                 try {
                     $api->orderFixExternalIds(array(array('id' => $order['id'], 'externalId' => $externalId)));
                 } catch (\RetailCrm\Exception\CurlException $e) {
                     self::eventLog('ICrmOrderActions::orderHistory', 'RetailCrm\\RestApi::orderFixExternalIds::CurlException', $e->getCode() . ': ' . $e->getMessage());
                     continue;
                 }
             }
             $order['externalId'] = $externalId;
         }
         if (isset($order['externalId']) && $order['externalId']) {
             // custom orderType function
             if (function_exists('intarocrm_set_order_type')) {
                 $orderType = intarocrm_set_order_type($order);
                 if ($orderType) {
                     $optionsOrderTypes[$order['orderType']] = $orderType;
                 } else {
                     $optionsOrderTypes[$order['orderType']] = $defaultOrderType;
                 }
             }
             $arFields = CSaleOrder::GetById($order['externalId']);
             // incorrect order
             if ($arFields === false || empty($arFields)) {
                 continue;
             }
             $LID = $arFields['LID'];
             $userId = $arFields['USER_ID'];
             if (isset($order['customer']['externalId']) && !is_null($order['customer']['externalId'])) {
                 $userId = $order['customer']['externalId'];
             }
             $rsOrderProps = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $arFields['ID']));
             $arUpdateProps = array();
             while ($ar = $rsOrderProps->Fetch()) {
                 $prop = CSaleOrderProps::GetByID($ar['ORDER_PROPS_ID']);
                 $arUpdateProps[$ar['CODE']] = array('ID' => $ar['ID'], 'TYPE' => $prop['TYPE'], 'VALUE' => $ar['VALUE']);
             }
             $order['fio'] = trim(implode(' ', array(isset($order['lastName']) ? $order['lastName'] : '', isset($order['firstName']) ? $order['firstName'] : '', isset($order['patronymic']) ? $order['patronymic'] : '')));
             if (isset($order['delivery']['address']['city'])) {
                 $order['location'] = $order['delivery']['address']['city'];
             }
             if (isset($order['orderType']) && isset($optionsOrderTypes[$order['orderType']])) {
                 if (isset($optionsOrderProps[$arFields['PERSON_TYPE_ID']])) {
                     foreach ($optionsOrderProps[$arFields['PERSON_TYPE_ID']] as $code => $value) {
                         if (in_array($code, array_keys($order)) === false && isset($optionsOrderProps[$optionsOrderTypes[$order['orderType']]][$code])) {
                             $order[$code] = $arUpdateProps[$optionsOrderProps[$arFields['PERSON_TYPE_ID']][$code]]['VALUE'];
                         }
                     }
                 }
                 //update ordertype
                 CSaleOrder::Update($order['externalId'], array('PERSON_TYPE_ID' => $optionsOrderTypes[$order['orderType']]));
                 $arProp = CSaleOrderProps::GetList(array(), array('PERSON_TYPE_ID' => $optionsOrderTypes[$order['orderType']]));
                 $typeParam = array();
                 while ($ar = $arProp->Fetch()) {
                     $typeParam[$ar['CODE']] = $ar['CODE'];
                 }
                 foreach (array_diff_key($arUpdateProps, $typeParam) as $code => $param) {
                     if (isset($arUpdateProps[$code])) {
                         CSaleOrderPropsValue::Delete($param['ID']);
                     }
                 }
                 $arFields['PERSON_TYPE_ID'] = $optionsOrderTypes[$order['orderType']];
             }
             array_walk_recursive(self::clearArr($order), 'self::recursiveUpdate', array('update' => $arUpdateProps, 'type' => $arFields['PERSON_TYPE_ID'], 'options' => $optionsOrderProps, 'orderId' => $order['externalId']));
             foreach ($order['items'] as $item) {
                 if (isset($item['deleted']) && $item['deleted']) {
                     if ($p = CSaleBasket::GetList(array(), array('ORDER_ID' => $order['externalId'], 'PRODUCT_ID' => $item['id']))->Fetch()) {
开发者ID:Ksenobyte,项目名称:bitrix-module,代码行数:67,代码来源:ICrmOrderActions.php


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