Created
December 10, 2015 06:52
-
-
Save chebanenko/b853b97709666105e269 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$price_agregator_hlblock_id = 8; | |
$link_hlblock_id = 7; | |
/** | |
* забираем инфу о сущности из БД | |
*/ | |
$price_agregator_hlblock = HL\HighloadBlockTable::getById($price_agregator_hlblock_id)->fetch(); | |
$link_hlblock = HL\HighloadBlockTable::getById($link_hlblock_id)->fetch(); | |
/** | |
* инициализация сущности | |
* @var \Bitrix\Main\Entity\Base $entity | |
*/ | |
$price_agregator_entity = HL\HighloadBlockTable::compileEntity($price_agregator_hlblock); | |
$link_entity = HL\HighloadBlockTable::compileEntity($link_hlblock); | |
/** | |
* | |
* @var \Bitrix\Main\Entity\DataManager $dataClass | |
*/ | |
$PriceAgregatorDataClass = $price_agregator_entity->getDataClass(); | |
$LinkDataClass = $link_entity->getDataClass(); | |
/********************************************************************** | |
* ВЫБОРКА ЭЛЕМЕНТОВ СПИСКА | |
*********************************************************************/ | |
// включаем sql tracker | |
\Bitrix\Main\Application::getConnection()->startTracker(); | |
$dbIblockElementResult = \Bitrix\Iblock\ElementTable::getList([ | |
'select' => [ | |
'ELEMENT_ID' => 'ID', | |
'ELEMENT_IBLOCK_ID' => 'IBLOCK_ID', | |
'ELEMENT_NAME' => 'NAME', | |
'ELEMENT_ACTIVE' => 'ACTIVE', | |
'ELEMENT_XML_ID' => 'XML_ID', | |
'ELEMENT_SECTION_ID' => 'IBLOCK_SECTION_ID', | |
'PRICE' => 'SALE.PRICE', | |
'CURRENCY' => 'SALE.CURRENCY', | |
'QUANTITY' => 'SALE.QUANTITY', | |
'AGREGATOR_ID' => 'LINK.UF_PRICE_AGREGATOR', | |
'AGREGATOR_NAME' => 'PRICEAGREGATOR.UF_NAME', | |
'AGREGATOR_XML_ID' => 'PRICEAGREGATOR.UF_XML_ID', | |
], | |
'filter' => $arFilter, | |
'runtime' => [ | |
'LINK' => [ | |
'data_type' => $LinkDataClass, | |
'reference' => array( | |
'=this.ID' => 'ref.UF_ELEMENT_ID' | |
), | |
'join_type' => 'left' | |
], | |
'PRICEAGREGATOR' => [ | |
'data_type' => $PriceAgregatorDataClass, | |
'reference' => array( | |
'=this.AGREGATOR_ID' => 'ref.ID' | |
), | |
'join_type' => 'left' | |
], | |
'SALE' => array( | |
'data_type' => '\Bitrix\Sale\ProductTable', | |
'reference' => array( | |
'=this.ID' => 'ref.ID' | |
), | |
'join_type' => 'inner' | |
), | |
] | |
]); | |
//dump($dbIblockElementResult->getTrackerQuery()->getTime()); | |
//dump($dbIblockElementResult->getTrackerQuery()->getSql()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment