Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $lkaExists = [];
- $lkkExists = [];
- // LkkInfo
- foreach (bx_hl_select(91) as $item)
- {
- $code = $item['UF_USER_CODE'];
- if (!$code)
- {
- continue;
- }
- $lkkExists[$code] = true;
- }
- // LkaAbonentInfo
- foreach (bx_hl_select(36) as $item)
- {
- $code = $item['UF_USER_CODE'];
- if (!$code)
- {
- continue;
- }
- $lkaExists[$code] = true;
- }
- $lkkUsers = [];
- $lkaUsers = [];
- $lkgUsers = [];
- $otherUsers = [];
- foreach (Bx\User\UserModel::getList() as $user)
- {
- // Exclude admins.
- if ($user->isGroup(1))
- {
- continue;
- }
- $userCode = $user['UF_CODE_LKA'];
- $isLkk = $userCode && ($lkkExists[$userCode] ?: false);
- $isLka = $userCode && ($lkaExists[$userCode] ?: false);
- $isLkg = $user->isGroup('lkg');
- $isLkkOnly = $isLkk && !$isLka && !$isLkg;
- $isLkaOnly = $isLka && !$isLkk && !$isLkg;
- $isLkgOnly = $isLkg && !$isLka && !$isLkk;
- if ($isLkkOnly)
- {
- $lkkUsers[] = $user;
- continue;
- }
- if ($isLkaOnly)
- {
- $lkaUsers[] = $user;
- continue;
- }
- if ($isLkgOnly)
- {
- $lkgUsers[] = $user;
- continue;
- }
- $otherUsers[] = $user;
- }
- echo 'lkk: '.count($lkkUsers).PHP_EOL;
- echo 'lka: '.count($lkaUsers).PHP_EOL;
- echo 'lkg: '.count($lkgUsers).PHP_EOL;
- echo 'others: '.count($otherUsers).PHP_EOL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement