Created
December 17, 2021 09:06
-
-
Save luckydevilru/e2cb854637a251891fbe3bea132957b8 to your computer and use it in GitHub Desktop.
Получить список пользователей подразделений Department bitrix24 php
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
<?php | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); | |
} | |
use Bitrix\Main\UserTable; | |
CModule::IncludeModule("timeman"); | |
$obImport = new Bitrix\Timeman\Monitor\Utils\Department; | |
$tsokDepartmentList = $obImport->getSubordinateDepartments("20"); | |
// СОСТАВЛЯЕМ СПИСОК МЕНЕДЖЕРОВ ПОДРАЗДЕЛЕНИЙ КОП | |
$filter = ['UF_DEPARTMENT' => $tsokDepartmentList]; | |
$rsUsers = UserTable::getList(Array( | |
"select"=>Array("ID","NAME","LAST_NAME"), | |
"filter"=>$filter, | |
))->fetchAll(); | |
foreach ($rsUsers as $key => $value) { | |
$userList[] = $value['ID']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment