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


PHP CSaleUserAccount类代码示例

本文整理汇总了PHP中CSaleUserAccount的典型用法代码示例。如果您正苦于以下问题:PHP CSaleUserAccount类的具体用法?PHP CSaleUserAccount怎么用?PHP CSaleUserAccount使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OnBeforeUserDeleteHandler

 function OnBeforeUserDeleteHandler($user_id)
 {
     \CModule::IncludeModule("iblock");
     \CModule::IncludeModule("sale");
     //Привязки к соц. сетям
     $arrFilter = array("IBLOCK_ID" => USER_SOCIAL_IB, "PROPERTY_USER_ID" => $user_id);
     $arSelect = array("ID");
     $rsRes = \CIBlockElement::GetList($arOrder, $arrFilter, false, false, $arSelect);
     while ($arItem = $rsRes->GetNext()) {
         \CIBlockElement::Delete($arItem["ID"]);
     }
     //Удаляем записи
     $result = \Hawkart\Megatv\RecordTable::getList(array('filter' => array("UF_USER_ID" => $user_id), 'select' => array("ID")));
     while ($arRecord = $result->fetch()) {
         \CRecordEx::delete($arRecord["ID"]);
     }
     //Удаляем счет
     if ($arAccount = \CSaleUserAccount::GetByUserID($user_id, "RUR")) {
         \CSaleUserAccount::Delete($arAccount["ID"]);
     }
     //Удаляем заказы
     $arFilter = array("USER_ID" => $user_id);
     $db_sales = \CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
     while ($ar_sales = $db_sales->Fetch()) {
         \CSaleOrder::Delete($ar_sales["ID"]);
     }
     //Удаляем подписки
     $result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("=UF_USER_ID" => $user_id), 'select' => array("ID")));
     if ($arSub = $result->fetch()) {
         \Hawkart\Megatv\SubscribeTable::delete($arSub["ID"]);
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:32,代码来源:CUserEx.php

示例2: budget

 public static function budget($user_id)
 {
     CModule::IncludeModule("sale");
     global $USER;
     if (!$user_id) {
         $user_id = $USER->GetID();
     }
     $dbAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $user_id), false, false, array("CURRENT_BUDGET", "CURRENCY"));
     if ($arAccount = $dbAccount->Fetch()) {
         return $arAccount["CURRENT_BUDGET"];
     } else {
         return false;
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:14,代码来源:CSaleAccountEx.php

示例3: prepareData

 public static function prepareData(Order $order)
 {
     $currencyBudget = 0;
     if ($order->getUserId() > 0) {
         $res = \CSaleUserAccount::getList(array(), array('USER_ID' => $order->getUserId(), 'CURRENCY' => $order->getCurrency(), 'LOCKED' => 'N'), false, false, array('CURRENT_BUDGET'));
         $userAccount = $res->Fetch();
         $currencyBudget = $userAccount['CURRENT_BUDGET'];
     }
     $payable = $order->getPrice() - $order->getSumPaid();
     $price = $order->getPrice();
     $sumPaid = $order->getSumPaid();
     $data = array('PRICE' => $price ? $price : 0, 'SUM_PAID' => $sumPaid ? $sumPaid : 0, 'PAYABLE' => $payable >= 0 ? $payable : 0, 'CURRENCY' => $order->getCurrency(), 'BUYER_BUDGET' => $currencyBudget, 'STATUS_ID' => $order->getField('STATUS_ID'));
     return $data;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:14,代码来源:orderfinanceinfo.php

示例4: OnSalePayOrder

 public static function OnSalePayOrder($ID, $val)
 {
     $ID = intval($ID);
     if ($ID > 0 && $val == 'Y') {
         $arOrder = array();
         $dbBasketItems = CSaleBasket::GetList(array(), array('ORDER_ID' => $ID), false, false, array('ID', 'MODULE', 'CATALOG_XML_ID', 'QUANTITY'));
         while ($arItems = $dbBasketItems->Fetch()) {
             if ($arItems['MODULE'] == 'asd.money' && !empty($arItems['CATALOG_XML_ID']) && strpos($arItems['CATALOG_XML_ID'], '@') !== false) {
                 if (empty($arOrder)) {
                     $rsOrders = CSaleOrder::GetList(array(), array('ID' => $ID), false, false, array('ID', 'USER_ID'));
                     $arOrder = $rsOrders->Fetch();
                     if (empty($arOrder)) {
                         return;
                     }
                 }
                 list($amount, $curr) = explode('@', $arItems['CATALOG_XML_ID']);
                 CSaleUserAccount::UpdateAccount($arOrder['USER_ID'], doubleval($amount) * doubleval($arItems['QUANTITY']), $curr, GetMessage('ASD_MODULE_TRANSACT_PREPAID'), $ID);
             }
         }
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:21,代码来源:include.php

示例5: ShowError

    die;
}
$this->setFramemode(false);
if (!CModule::IncludeModule("sale")) {
    ShowError(GetMessage("SALE_MODULE_NOT_INSTALL"));
    return;
}
if (!CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
    return;
}
if (!$USER->IsAuthorized()) {
    $APPLICATION->AuthForm(GetMessage("SALE_ACCESS_DENIED"), false, false, 'N', false);
}
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
if ($arParams["SET_TITLE"] == 'Y') {
    $APPLICATION->SetTitle(GetMessage("SPA_TITLE"));
}
$dbAccountList = CSaleUserAccount::GetList(array("CURRENCY" => "ASC"), array("USER_ID" => IntVal($USER->GetID())), false, false, array("ID", "CURRENT_BUDGET", "CURRENCY", "TIMESTAMP_X"));
if ($arAccountList = $dbAccountList->GetNext()) {
    $arResultTmp = array();
    $arResult["DATE"] = str_replace("#DATE#", date(CDatabase::DateFormatToPHP(CSite::GetDateFormat("SHORT", SITE_ID))), GetMessage("SPA_MY_ACCOUNT"));
    do {
        $arResultTmp["CURRENCY"] = CCurrencyLang::GetByID($arAccountList["CURRENCY"], LANGUAGE_ID);
        $arResultTmp["ACCOUNT_LIST"] = $arAccountList;
        $arResultTmp["INFO"] = str_replace("#CURRENCY#", $arResultTmp["CURRENCY"]["CURRENCY"] . " (" . $arResultTmp["CURRENCY"]["FULL_NAME"] . ")", str_replace("#SUM#", SaleFormatCurrency($arAccountList["CURRENT_BUDGET"], $arAccountList["CURRENCY"]), GetMessage("SPA_IN_CUR")));
        $arResult["ACCOUNT_LIST"][] = $arResultTmp;
    } while ($arAccountList = $dbAccountList->GetNext());
} else {
    $arResult["ERROR_MESSAGE"] = GetMessage("SPA_NO_ACCOUNT");
}
$this->IncludeComponentTemplate();
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:component.php

示例6: NextPayment


//.........这里部分代码省略.........
						"SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@".$SERVER_NAME)
					);
					$eventName = "SALE_NEW_ORDER_RECURRING";

					$bSend = true;
					foreach(GetModuleEvents("sale", "OnOrderRecurringSendEmail", true) as $arEvent)
					{
						if (ExecuteModuleEventEx($arEvent, Array($newOrderID, &$eventName, &$arFields))===false)
							$bSend = false;
					}

					if($bSend)
					{
						$event = new CEvent;
						$event->Send($eventName, $arOrder["LID"], $arFields, "N");
					}
				}

				if ($bSuccess)
					$DB->Commit();
				else
					$DB->Rollback();
			}
		}
		else
		{
			$totalOrderPrice = $arOrder["PRICE"];
			$baseSiteCurrency = $arOrder["CURRENCY"];
		}

		$res = False;
		if ($bSuccess)
		{
			$res = CSaleUserAccount::Pay($arOrder["USER_ID"], $totalOrderPrice, $baseSiteCurrency, $newOrderID, True);
			if ($res)
			{
				if ($arProduct["WITHOUT_ORDER"] == "N")
				{
					CSaleOrder::PayOrder($newOrderID, "Y", False, False, $arRecur["ID"]);
					CSaleOrder::DeliverOrder($newOrderID, "Y", $arRecur["ID"]);
					CSaleOrder::DeductOrder($newOrderID, "Y", "", true, array(), $arRecur["ID"]);
				}
				else
				{
					/** @var $productProvider IBXSaleProductProvider */
					if ($productProvider = CSaleBasket::GetProductProvider($arProduct))
					{
						$r = $productProvider::DeliverProduct(array(
							"PRODUCT_ID" => $arProduct["PRODUCT_ID"],
							"USER_ID"    => $arOrder["USER_ID"],
							"PAID"       => true
						));
					}
					else
					{
						$r = CSaleBasket::ExecuteCallbackFunction(
							$arProduct["PAY_CALLBACK_FUNC"],
							$arRecur["MODULE"],
							$arProduct["PRODUCT_ID"],
							$arOrder["USER_ID"],
							true
						);
					}
				}

				$arFields = array(
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:67,代码来源:recurring.php

示例7: array

}
if ($arParams['PAY_IMMED']) {
    if (isset($arParams['PERSON_TYPE']) && $arParams['PERSON_TYPE'] > 0) {
        $arResult['PAY_SYSTEMS'] = array();
        $dbPaySysAction = CSalePaySystemAction::GetList(array(), array('PS_ACTIVE' => 'Y', 'PERSON_TYPE_ID' => $arParams['PERSON_TYPE']), false, false, array('*'));
        while ($arPaySysAction = $dbPaySysAction->fetch()) {
            if (intval($arPaySysAction['LOGOTIP']) > 0) {
                $arPaySysAction['LOGOTIP'] = CFile::GetFileArray($arPaySysAction['LOGOTIP']);
            }
            $arResult['PAY_SYSTEMS'][$arPaySysAction['PAY_SYSTEM_ID']] = $arPaySysAction;
        }
    } else {
        $arParams['PAY_IMMED'] = false;
    }
}
$rsAcc = CSaleUserAccount::GetList(array('CURRENCY' => 'ASC'), array('USER_ID' => $USER->GetID()), false, false, array('ID', 'CURRENT_BUDGET', 'CURRENCY', 'LOCKED'));
while ($arAcc = $rsAcc->GetNext(true, false)) {
    if (empty($arParams['ALLOWED_CURRENCY']) || in_array($arAcc['CURRENCY'], $arParams['ALLOWED_CURRENCY'])) {
        $arAcc['CURRENT_BUDGET_FORMATED'] = SaleFormatCurrency($arAcc['CURRENT_BUDGET'], $arAcc['CURRENCY']);
        $arResult['ACCOUNT'][$arAcc['CURRENCY']] = $arAcc;
    }
}
foreach ($arResult['ACCOUNT'] as $curr => &$arAcc) {
    if (empty($arAcc)) {
        $arAcc = array('CURRENT_BUDGET' => 0.0, 'CURRENCY' => $curr, 'CURRENT_BUDGET_FORMATED' => SaleFormatCurrency(0, $curr));
    }
}
if ($_REQUEST['prepaid_money'] != '' && check_bitrix_sessid()) {
    $arResult['MONEY_OFF'] = round($arResult['REQUEST_AMOUNT'] + $arResult['REQUEST_AMOUNT'] / 100 * $arParams['COMISSION'], 2);
    if ($arResult['REQUEST_AMOUNT'] <= 0 || $arResult['REQUEST_ACCOUNT'] == '') {
        $arResult['ERROR'] = GetMessage('SPT_ERROR_REQUIRED_AMOUNT');
开发者ID:Hawkart,项目名称:megatv,代码行数:31,代码来源:component.php

示例8: array

            $fieldValue .= "</a>";
        } else {
            $fieldValue .= 0;
        }
    }
    $row->AddField("TRANSACT", $fieldValue);
    $arActions = array();
    $arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("SAA_UPDATE_ALT"), "ACTION" => $lAdmin->ActionRedirect("sale_account_edit.php?ID=" . $f_ID . "&lang=" . LANG . GetFilterParams("filter_")), "DEFAULT" => true);
    if ($saleModulePermissions >= "W") {
        $arActions[] = array("SEPARATOR" => true);
        $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("SAA_DELETE_ALT"), "ACTION" => "if(confirm('" . GetMessage('SAA_DELETE_CONFIRM') . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete"));
    }
    $row->AddActions($arActions);
}
$arFooterArray = array(array("title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $dbResultList->SelectedRowsCount()));
$dbAccountCurrency = CSaleUserAccount::GetList(array("CURRENCY" => "ASC"), $arFilter, array("CURRENCY", "SUM" => "CURRENT_BUDGET"), false, array("CURRENCY", "SUM" => "CURRENT_BUDGET"));
while ($arAccountCurrency = $dbAccountCurrency->Fetch()) {
    $arFooterArray[] = array("title" => GetMessage("SAA_ITOG") . " " . $arAccountCurrency["CURRENCY"] . ":", "value" => SaleFormatCurrency($arAccountCurrency["CURRENT_BUDGET"], $arAccountCurrency["CURRENCY"]));
}
$order_sum = "";
foreach ($arFooterArray as $val) {
    $order_sum .= $val["title"] . " " . $val["value"] . "<br />";
}
$lAdmin->sEpilogContent = "<script>setTimeout(function(){if (document.getElementById('order_sum'))document.getElementById('order_sum').innerHTML = '" . CUtil::JSEscape($order_sum) . "';}, 10);</script>";
$lAdmin->AddGroupActionTable(array("delete" => GetMessage("MAIN_ADMIN_LIST_DELETE"), "unlock" => GetMessage("SAAN_UNLOCK_DO")));
$aContext = array();
if ($saleModulePermissions >= "W") {
    $aContext = array(array("TEXT" => GetMessage("SAAN_ADD_NEW"), "LINK" => "sale_account_edit.php?lang=" . LANG . GetFilterParams("filter_"), "TITLE" => GetMessage("SAAN_ADD_NEW_ALT"), "ICON" => "btn_new"));
}
$lAdmin->AddAdminContextMenu($aContext);
$lAdmin->CheckListMode();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:account_admin.php

示例9: getDemandedFields

 protected function getDemandedFields(array $demandedFields, array $incomingFields, \Bitrix\Sale\Order $order = null)
 {
     $result = array();
     $userId = isset($incomingFields["USER_ID"]) && intval($incomingFields["USER_ID"]) > 0 ? intval($incomingFields["USER_ID"]) : 0;
     $currency = isset($incomingFields["CURRENCY"]) ? trim($incomingFields["CURRENCY"]) : "";
     $personTypeId = isset($incomingFields['PERSON_TYPE_ID']) ? intval($incomingFields['PERSON_TYPE_ID']) : 0;
     $orderId = isset($incomingFields["ID"]) ? intval($incomingFields["ID"]) : 0;
     if ($order === null && intval($orderId) > 0) {
         $order = \Bitrix\Sale\Order::load($orderId);
     }
     foreach ($demandedFields as $demandedField) {
         switch ($demandedField) {
             case "BUYER_USER_NAME":
                 $result["BUYER_USER_NAME"] = intval($userId) > 0 ? \Bitrix\Sale\Helpers\Admin\OrderEdit::getUserName(intval($userId)) : "";
                 break;
             case "PROPERTIES":
                 $profileId = isset($incomingFields["BUYER_PROFILE_ID"]) ? intval($incomingFields["BUYER_PROFILE_ID"]) : 0;
                 $result["PROPERTIES"] = \Bitrix\Sale\Helpers\Admin\Blocks\OrderBuyer::getProfileParams($userId, $profileId);
                 break;
             case "BUYER_PROFILES_LIST":
                 if (intval($personTypeId) <= 0) {
                     throw new \Bitrix\Main\ArgumentNullException("personTypeId");
                 }
                 $result["BUYER_PROFILES_LIST"] = \Bitrix\Sale\Helpers\Admin\Blocks\OrderBuyer::getBuyerProfilesList($userId, $personTypeId);
                 break;
             case "BUYER_PROFILES_DATA":
                 $result["BUYER_PROFILES_DATA"] = \Bitrix\Sale\Helpers\Admin\Blocks\OrderBuyer::getUserProfiles($userId);
                 break;
             case "BUYER_BUDGET":
                 $res = \CSaleUserAccount::getList(array(), array('USER_ID' => $userId, 'CURRENCY' => $currency, 'LOCKED' => 'N'), false, false, array('CURRENT_BUDGET'));
                 if ($userAccount = $res->Fetch()) {
                     $result["BUYER_BUDGET"] = $userAccount['CURRENT_BUDGET'];
                 } else {
                     $result["BUYER_BUDGET"] = 0;
                 }
                 break;
             case "PROPERTIES_ARRAY":
                 if (!$order) {
                     throw new \Bitrix\Main\SystemException("Can't init order");
                 }
                 if (intval($personTypeId) <= 0) {
                     throw new \Bitrix\Main\ArgumentNullException("personTypeId");
                 }
                 $order->setPersonTypeId($personTypeId);
                 $result["PROPERTIES_ARRAY"] = $order->getPropertyCollection()->getArray();
                 break;
             case "PRODUCT":
                 $result["PRODUCT"] = array();
                 break;
             case "COUPONS":
                 if (!$userId) {
                     throw new \Bitrix\Main\ArgumentNullException("userId");
                 }
                 $result["COUPONS"] = Admin\OrderEdit::getCouponsData();
                 break;
             case "COUPONS_LIST":
                 $result["COUPONS_LIST"] = Admin\OrderEdit::getCouponList($order);
                 break;
             default:
                 throw new \Bitrix\Main\SystemException("Field: \"" . $demandedField . "\" is unknown!");
         }
     }
     return $result;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:64,代码来源:order_ajax.php

示例10: PayUserAccountDeliveryOrderCallback

function PayUserAccountDeliveryOrderCallback($productID, $userID, $bPaid, $orderID, $quantity = 1)
{
    global $DB;
    $productID = IntVal($productID);
    $userID = IntVal($userID);
    $bPaid = $bPaid ? True : False;
    $orderID = IntVal($orderID);
    if ($userID <= 0) {
        return False;
    }
    if ($orderID <= 0) {
        return False;
    }
    if (!($arOrder = CSaleOrder::GetByID($orderID))) {
        return False;
    }
    $baseLangCurrency = CSaleLang::GetLangCurrency($arOrder["LID"]);
    $arAmount = unserialize(COption::GetOptionString("sale", "pay_amount", 'a:4:{i:1;a:2:{s:6:"AMOUNT";s:2:"10";s:8:"CURRENCY";s:3:"EUR";}i:2;a:2:{s:6:"AMOUNT";s:2:"20";s:8:"CURRENCY";s:3:"EUR";}i:3;a:2:{s:6:"AMOUNT";s:2:"30";s:8:"CURRENCY";s:3:"EUR";}i:4;a:2:{s:6:"AMOUNT";s:2:"40";s:8:"CURRENCY";s:3:"EUR";}}'));
    if (!array_key_exists($productID, $arAmount)) {
        return False;
    }
    $currentPrice = $arAmount[$productID]["AMOUNT"] * $quantity;
    $currentCurrency = $arAmount[$productID]["CURRENCY"];
    if ($arAmount[$productID]["CURRENCY"] != $baseLangCurrency) {
        $currentPrice = CCurrencyRates::ConvertCurrency($arAmount[$productID]["AMOUNT"], $arAmount[$productID]["CURRENCY"], $baseLangCurrency) * $quantity;
        $currentCurrency = $baseLangCurrency;
    }
    if (!CSaleUserAccount::UpdateAccount($userID, $bPaid ? $currentPrice : -$currentPrice, $currentCurrency, "MANUAL", $orderID, "Payment to user account")) {
        return False;
    }
    return True;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:32,代码来源:include.php

示例11: getOrderInfoDetail

 function getOrderInfoDetail($orderId)
 {
     if (!$orderId) {
         return false;
     }
     if (!$GLOBALS["USER"]->IsAuthorized()) {
         return false;
     }
     $arFilter["ID"] = $orderId;
     $saleModulePermissions = $GLOBALS["APPLICATION"]->GetGroupRight("sale");
     if ($saleModulePermissions == "D") {
         $arFilter["USER_ID"] = IntVal($GLOBALS["USER"]->GetID());
     } elseif ($saleModulePermissions != "W") {
         $arFilter["STATUS_PERMS_GROUP_ID"] = $GLOBALS["USER"]->GetUserGroupArray();
         $arFilter[">=STATUS_PERMS_PERM_VIEW"] = "Y";
     }
     $arOrder = array();
     $dbOrder = CSaleOrder::GetList(array(), $arFilter);
     $arOrder = $dbOrder->GetNext();
     if (!$arOrder) {
         return false;
     }
     $arOrder["STATUS"] = CSaleStatus::GetLangByID($arOrder["STATUS_ID"]);
     $arOrder["STATUS_NAME"] = $arOrder["STATUS"]["NAME"];
     $arOrder["PRICE_IN_ALL_NUM"] = floatval($arOrder["~PRICE"] + floatval($arOrder["~PRICE_DELIVERY"]));
     $arOrder["PRICE_IN_ALL"] = SaleFormatCurrency($arOrder["PRICE_IN_ALL_NUM"], $arOrder["CURRENCY"]);
     $arOrder["PRICE_STR"] = SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]);
     $arOrder["PERSON_TYPE"] = CSalePersonType::GetByID($arOrder["PERSON_TYPE_ID"]);
     $arOrder["PERSON_TYPE_NAME"] = htmlspecialcharsbx($arOrder["PERSON_TYPE"]["NAME"]);
     $arOrder = self::getOrderProps($arOrder);
     $arOrder["DELIVERY_NAME"] = self::getDeliveriesInfo(array($arOrder["DELIVERY_ID"]));
     $arOrder["DELIVERY_NAME"] = $arOrder["DELIVERY_NAME"][$arOrder["DELIVERY_ID"]];
     $arPaySys = CSalePaySystem::GetByID($arOrder["PAY_SYSTEM_ID"], $arOrder["PERSON_TYPE_ID"]);
     $arOrder["PAY_SYSTEM_NAME"] = $arPaySys["NAME"];
     $dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $arOrder["USER_ID"], "CURRENCY" => $arOrder["CURRENCY"], "LOCKED" => "N"));
     $arUserAccount = $dbUserAccount->GetNext();
     $arOrder["CURRENT_BUDGET"] = $arUserAccount["CURRENT_BUDGET"] ? $arUserAccount["CURRENT_BUDGET"] : 0;
     $arOrder["CURRENT_BUDGET_STRING"] = SaleFormatCurrency($arOrder["CURRENT_BUDGET"], $arOrder["CURRENCY"]);
     return $arOrder;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:40,代码来源:mobile_order.php

示例12: getPaySystemList

 /**
  * @param null $order
  * @return array
  */
 public static function getPaySystemList($order = null)
 {
     $result = array();
     $result[] = array('ID' => '0', 'NAME' => Loc::getMessage('SALE_ORDER_PAYMENT_NO_PAYSYSTEM'));
     if ($order) {
         self::$order = $order;
     } else {
         if (!self::$order) {
             return $result;
         }
     }
     $res = \CSaleUserAccount::getList(array(), array('USER_ID' => self::$order->getUserId(), 'CURRENCY' => self::$order->getCurrency(), 'LOCKED' => 'N'), false, false, array('CURRENT_BUDGET'));
     $userAccount = $res->Fetch();
     $dbRes = PaySystemServiceTable::getListWithInner(array('select' => array('ID', 'NAME'), 'filter' => array('=ACTION.PERSON_TYPE_ID' => self::$order->getPersonTypeId(), '=ACTION.HAVE_PAYMENT' => 'Y', '=ACTIVE' => 'Y'), 'order' => array('SORT' => 'ASC')));
     while ($paySystem = $dbRes->fetch()) {
         if ($userAccount['CURRENT_BUDGET'] <= 0 && $paySystem["ID"] == PaySystemInner::getId()) {
             continue;
         }
         $result[] = array('ID' => $paySystem['ID'], 'NAME' => $paySystem["NAME"] . " [" . $paySystem["ID"] . "]");
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:26,代码来源:orderpayment.php

示例13: OnBeforeUserDelete

 public static function OnBeforeUserDelete($userID)
 {
     $userID = IntVal($userID);
     $bCanDelete = True;
     $dbUserAccounts = CSaleUserAccount::GetList(array(), array("USER_ID" => $userID, "!CURRENT_BUDGET" => 0), false, false, array("ID"));
     if ($arUserAccount = $dbUserAccounts->Fetch()) {
         $GLOBALS["APPLICATION"]->ThrowException(str_replace("#USER_ID#", $userID, GetMessage("UA_ERROR_USER")), "ERROR_UACCOUNT");
         return False;
     }
     return $bCanDelete;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:11,代码来源:user.php

示例14: GetMessage

echo $arResult["arUser"]["WORK_PHONE"];
?>
" /></td>
		</tr>
	</tbody>
</table>

<div style="margin-top:10px;"><input type="submit" name="save" value="<?php 
echo $arResult["ID"] > 0 ? GetMessage("MAIN_SAVE") : GetMessage("MAIN_ADD");
?>
">&nbsp;&nbsp;<input type="reset" value="<?php 
echo GetMessage('MAIN_RESET');
?>
"></div>
</form>
</div>
  </div>
                </div>
            </div>
<div class="balance-div">
<?php 
$dsd = CSaleUserAccount::GetList(array(), array("USER_ID" => $USER->GetID()), false, false, array("CURRENT_BUDGET", "CURRENCY"));
$userAcc = $dsd->GetNext();
?>
<span class="bonus-title">Бонусов доступно: </span><br><br><span class="bonus-balance"><?php 
echo intval($userAcc['CURRENT_BUDGET']);
?>
</span><br>
<span class="smallnotes-balance">Бонусы начисляются за каждую покупку.</span>
</div>
<div class="clear"></div>
开发者ID:Andreyjktl,项目名称:kidster,代码行数:31,代码来源:template.php

示例15: __IncludeLang

}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__), $lang));
$dbPerson = CSalePersonType::GetList(array());
if (!$dbPerson->Fetch()) {
    //Person Types
    $arGeneralInfo["personType"]["fiz"] = CSalePersonType::Add(array("LID" => $siteID, "NAME" => GetMessage("SALE_WIZARD_PERSON_1"), "SORT" => "100"));
    $arGeneralInfo["personType"]["ur"] = CSalePersonType::Add(array("LID" => $siteID, "NAME" => GetMessage("SALE_WIZARD_PERSON_2"), "SORT" => "150"));
    //currecny to site
    $dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => 1));
    if (!$dbUserAccount->Fetch()) {
        if ($bRus) {
            CSaleLang::Add(array("LID" => $siteID, "CURRENCY" => "RUB"));
            CSaleUserAccount::Add(array("USER_ID" => 1, "CURRENT_BUDGET" => 1000, "CURRENCY" => "RUB"));
        } else {
            CSaleLang::Add(array("LID" => $siteID, "CURRENCY" => "USD"));
            CSaleUserAccount::Add(array("USER_ID" => 1, "CURRENT_BUDGET" => 100, "CURRENCY" => "USD"));
        }
    }
    //Sale administrators
    $userGroupID = "";
    $dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "sale_administrator"));
    if ($arGroup = $dbGroup->Fetch()) {
        $userGroupID = $arGroup["ID"];
    } else {
        $group = new CGroup();
        $arFields = array("ACTIVE" => "Y", "C_SORT" => 800, "NAME" => GetMessage("SALE_WIZARD_ADMIN_SALE"), "DESCRIPTION" => GetMessage("SALE_WIZARD_ADMIN_SALE_DESCR"), "USER_ID" => array(), "STRING_ID" => "sale_administrator");
        $userGroupID = $group->Add($arFields);
    }
    if (IntVal($userGroupID) > 0) {
        DemoSiteUtil::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
        CSaleGroupAccessToSite::Add(array("SITE_ID" => $siteID, "GROUP_ID" => $userGroupID));
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:step1.php


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