Created
June 16, 2022 12:56
-
-
Save luckydevilru/bfb0ac177cdcc34d161ab55b8a76eca9 to your computer and use it in GitHub Desktop.
highloadblock Bitrix24 runtime ReferenceField
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
<? | |
$hlbl = 6; | |
$hlblock = HL\HighloadBlockTable::getById($hlbl)->fetch(); | |
$entity = HL\HighloadBlockTable::compileEntity($hlblock); | |
$entity_data_class = $entity->getDataClass(); | |
$rsData = $entity_data_class::getList(array( | |
"select" => array( | |
"*", | |
'MANAGER_NAME' => 'USER.NAME', | |
'MANAGER_LAST_NAME' => 'USER.LAST_NAME', | |
'COMPANY_NAME' => 'COMPANY.TITLE', | |
'CONTACT_NAME' => 'CONTACT.NAME', | |
'CONTACT_LAST_NAME' => 'CONTACT.LAST_NAME', | |
), | |
"order" => array("ID" => "ASC"), | |
"filter" => array("<=UF_DATE_FROM"=>$lastDay,">=UF_DATE_TO"=>$dateFirst), // Задаем параметры фильтра выборки | |
"runtime" => [ | |
new \Bitrix\Main\Entity\( | |
'USER', | |
'\Bitrix\Main\UserTable', | |
array("=ref.ID" => "this.UF_EMPLOYEE",), | |
array("join_type"=>"LEFT") | |
), | |
new \Bitrix\Main\Entity\ReferenceField( | |
'COMPANY', | |
'\Bitrix\Crm\CompanyTable', | |
array("=ref.ID" => "this.UF_COMPANY",), | |
array("join_type"=>"LEFT") | |
), | |
new \Bitrix\Main\Entity\ReferenceField( | |
'CONTACT', | |
'\Bitrix\Crm\ContactTable', | |
array("=ref.ID" => "this.UF_CONTACT",), | |
array("join_type"=>"LEFT") | |
), | |
] | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment