Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/local/components/wbs24/highload/ |
Upload File : |
<?php use Bitrix\Main\Loader; use Bitrix\Main\SystemException; use Bitrix\Highloadblock; use Bitrix\Main\Entity; if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); class Wbs24Banner extends CBitrixComponent { public function onPrepareComponentParams($arParams) { return $arParams; } public function executeComponent() { $this->checkModules(); $this->arResult = $this->getInfoFromHighloadBlock($this->$arResult, $this->arParams); $this->IncludeComponentTemplate(); } protected function checkModules() { if (!Loader::includeModule('iblock')) { throw new SystemException("Iblock module isn`t installed"); } return true; } protected function getInfoFromHighloadBlock(&$arResult, &$arParams) { if (!Loader::includeModule('highloadblock')) { throw new SystemException("Highload block module isn`t installed"); } $hlblockDatas = Highloadblock\HighloadBlockTable::getById($arParams['HIGH_LOAD_BLOCK'])->fetch(); $entityHlBonus = Highloadblock\HighloadBlockTable::compileEntity($hlblockDatas); $entityDataClassBonus = $entityHlBonus->getDataClass(); $bonusData = $entityDataClassBonus::getList(array( 'select' => array('UF_BONUS_FROM', 'UF_BONUS_TO', 'UF_BONUS_PRICE'), )); $arResult['PRICES'] = []; while ($arBonusData = $bonusData->Fetch()) { $priceFrom = intval($arBonusData['UF_BONUS_FROM']); $priceTo = intval($arBonusData['UF_BONUS_TO']); $priceBonus = intval($arBonusData['UF_BONUS_PRICE']); $arResult['PRICES'][] = ['priceFrom' => $priceFrom, 'priceTo' => $priceTo, 'priceBonus' => $priceBonus]; } return $arResult; } }