Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luckydevilru/bfb0ac177cdcc34d161ab55b8a76eca9 to your computer and use it in GitHub Desktop.
Save luckydevilru/bfb0ac177cdcc34d161ab55b8a76eca9 to your computer and use it in GitHub Desktop.
highloadblock Bitrix24 runtime ReferenceField
<?
$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