1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Collab.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Recent\Initializer\Source;
4
5use Bitrix\Im\Model\RelationTable;
6use Bitrix\Im\V2\Recent\Initializer\BaseSource;
7use Bitrix\Im\V2\Recent\Initializer\InitialiazerResult;
8use Bitrix\Im\V2\Recent\Initializer\SourceType;
9use Bitrix\Im\V2\Recent\Initializer\Stage;
10use Bitrix\Im\V2\Recent\Initializer\StageType;
11use Bitrix\Main\ORM\Query\Query;
12
14{
15 public static function getType(): SourceType
16 {
17 return SourceType::Collab;
18 }
19
20 protected function getBaseQuery(string $pointer, int $limit): Query
21 {
22 $lastId = (int)$pointer;
23 $query = RelationTable::query()
24 ->setDistinct()
25 ->setSelect(['ID', self::USER_ID_FIELD_NAME => 'USER_ID'])
26 ->where('CHAT_ID', $this->sourceId)
27 ->whereNotNull('USER.LAST_ACTIVITY_DATE')
28 ->setLimit($limit)
29 ->setOrder(['ID' => 'DESC'])
30 ;
31
32 if ($lastId)
33 {
34 $query->where('ID', '<', $lastId);
35 }
36
37 return $query;
38 }
39
40 protected function getResultByRaw(array $raw, int $limit): InitialiazerResult
41 {
42 $selectedItemsCount = count($raw);
43 $userIds = [];
44 $nextId = null;
45 $hasNextStep = $selectedItemsCount >= $limit;
46
47 foreach ($raw as $row)
48 {
49 $id = (int)($row['ID']);
50 $userId = (int)($row[self::USER_ID_FIELD_NAME] ?? 0);
51 $userIds[$userId] = $userId;
52 if ($id < $nextId || $nextId === null)
53 {
54 $nextId = $id;
55 }
56 }
57
58 return (new InitialiazerResult())
59 ->setItems($userIds)
60 ->setNextPointer((string)$nextId)
61 ->setHasNextStep($hasNextStep)
62 ->setSelectedItemsCount($selectedItemsCount)
63 ;
64 }
65}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
getBaseQuery(string $pointer, int $limit)
Определения Collab.php:20
getResultByRaw(array $raw, int $limit)
Определения Collab.php:40
if(!\Bitrix\Main\Loader::includeModule('clouds')) $lastId
Определения sync.php:68
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$query
Определения get_search.php:11
Определения chain.php:3
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936