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


PHP CSaleOrderUserProps::GetByID方法代码示例

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


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

示例1: Update

    static function Update($profileID, $arFields) {
        global $DB;

        $result = new WS_SaleUserProfilesErrorsContainer();
        if (empty($profileID)) {
            return $result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_required_id"));
        }
        $DB->StartTransaction();

        if (!empty($arFields["PROPS"])) {
            $props = $arFields["PROPS"];
            unset($arFields["PROPS"]);
        }

        // сохраняем поля
        if (!empty($arFields)) {
            if(!$profileID = CSaleOrderUserProps::Update($profileID, $arFields)){
                $result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_save_fields"));
            } else {
                $arFields = CSaleOrderUserProps::GetByID($profileID);
            }
        }

        // сохраняем свойства
        if (!empty($props) && !$result->getErrorsAsString()) {
            // удаляем все свойства
            CSaleOrderUserPropsValue::DeleteAll($profileID);
            $res = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $arFields["PERSON_TYPE_ID"], "USER_PROPS" => "Y"), false, false, array());
            while ($arRes = $res->Fetch()) {
                if ($arRes['REQUIED'] === 'Y' && empty($props[$arRes['ID']])) {
                    $result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_required_field") . "\"" . $arRes["NAME"] . "\"");
                    continue;
                }

                $arValueTemp = $props[$arRes['ID']];
                if (is_array($arValueTemp)) {
                    $arValueTemp = "";

                    for ($i = 0; $i < count($props[$arRes['ID']]); $i++) {
                        if ($i > 0) {
                            $arValueTemp .= ",";
                        }
                        $arValueTemp .= $props[$arRes['ID']][$i];
                    }

                }

                $arProp = array(
                    "VALUE" => $arValueTemp,
                    "NAME" => $arRes["NAME"],
                    "ORDER_PROPS_ID" => $arRes['ID'],
                    "USER_PROPS_ID" => $profileID
                );
                CSaleOrderUserPropsValue::Add($arProp);
            }
        }

        if ($result->getErrorsAsString()) {
            $DB->Rollback();
        } else {
            $DB->Commit();
        }
        return $result;
    }
开发者ID:ASDAFF,项目名称:mp,代码行数:64,代码来源:profilesManager.php

示例2: IncludeModuleLangFile

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
IncludeModuleLangFile(__FILE__);
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions == "D") {
    $APPLICATION->AuthForm(GetMessage("BUYER_PE_ACCESS_DENIED"));
}
if (!CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
    require $DOCUMENT_ROOT . "/bitrix/modules/main/include/prolog_admin_after.php";
    ShowError(GetMessage("SALE_FEATURE_NOT_ALLOW"));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
    die;
}
ClearVars();
$ID = IntVal($_REQUEST["id"]);
$arErrors = array();
if ($arProfile = CSaleOrderUserProps::GetByID($ID)) {
    $USER_ID = IntVal($arProfile["USER_ID"]);
    $PERSON_TYPE = IntVal($arProfile["PERSON_TYPE_ID"]);
    $profileName = $arProfile["NAME"];
} else {
    $arErrors[] = GetMessage("BUYER_PE_NO_PROFILE");
}
/*****************************************************************************/
/**************************** SAVE PROFILE ***********************************/
/*****************************************************************************/
if ($REQUEST_METHOD == "POST" && $saleModulePermissions >= "U" && check_bitrix_sessid() && !empty($arProfile)) {
    $CODE_PROFILE_NAME = trim($_REQUEST["CODE_PROFILE_NAME"]);
    if (strlen($CODE_PROFILE_NAME) > 0) {
        $profileName = $CODE_PROFILE_NAME;
    }
    $arOrderPropsValues = array();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:buyers_profile_edit.php

示例3: intval

 require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
 if (isset($hrpd->MerchantInternalPaymentId)) {
     if ($hrpd->ErrorCode == 0) {
         if (CModule::IncludeModule('sale')) {
             $order_id = intval($hrpd->MerchantInternalPaymentId);
             if ($arOrder = CSaleOrder::GetByID(IntVal($order_id))) {
                 CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"]);
                 $urlGetMerchantInfo = 'http://payment.kaznachey.net/api/PaymentInterface/CreatePayment';
                 $urlGetClientMerchantInfo = 'http://payment.kaznachey.net/api/PaymentInterface/GetMerchatInformation';
                 $merchantGuid = CSalePaySystemAction::GetParamValue("MerchantId");
                 $merchnatSecretKey = CSalePaySystemAction::GetParamValue("SecretKey");
                 $order_id = IntVal($GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"]);
                 $selectedPaySystemId = 1;
                 $quantitys = 0;
                 $order_info = CSaleOrder::GetByID($order_id);
                 $user_info = CSaleOrderUserProps::GetByID($order_info['USER_ID']);
                 $user_fullinfo = CSaleOrderUserPropsValue::GetByID($order_info['USER_ID']);
                 $user_email = $USER->GetParam("EMAIL");
                 $user_id = $order_info['USER_ID'];
                 $amount = number_format($order_info['PRICE'], 2, '.', '');
                 $dbBasketItems = CSaleBasket::GetList(array(), array("ORDER_ID" => $order_id));
                 while ($arItems = $dbBasketItems->Fetch()) {
                     $quantitys += $arItems['QUANTITY'];
                 }
                 if ($order_info['PRICE_DELIVERY'] > 0) {
                     $quantitys += 1;
                 }
                 $quantitys = number_format($quantitys, 2, '.', '');
                 $signature_u = md5(md5($merchantGuid . $merchnatSecretKey . "{$amount}" . "{$quantitys}" . $order_id));
                 if ($hrpd->CustomMerchantInfo == $signature_u) {
                     $arFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $out_summ, "PS_CURRENCY" => "", "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
开发者ID:saxum2010,项目名称:kaznachey_Bitrix,代码行数:31,代码来源:kaznachey_result.php


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