1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
openeventpushscorer.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Internals\Counter\Processor\Handler;
4
5use Bitrix\Calendar\Event\Enum\PushCommandEnum;
6use Bitrix\Calendar\Integration\pull\PushService;
7use Bitrix\Calendar\Internals\Counter;
8use Bitrix\Main\UserTable;
9
11{
12 public function __invoke(array $userIds, array $categoryIds): void
13 {
14 if (empty($userIds) || empty($categoryIds))
15 {
16 return;
17 }
18
19 foreach($this->getUsersOnline($userIds) as $user)
20 {
21 $userId = (int)$user['ID'];
22 $params = [];
23
24 // counter for common category
25 $params['categoriesCounter'][0] = Counter::getInstance($userId)
27
28 foreach ($categoryIds as $categoryId)
29 {
30 $categoryId = (int)$categoryId;
31 $categoryCounter = Counter::getInstance($userId)
33
34 $params['categoriesCounter'][$categoryId] = $categoryCounter;
35 }
36
37 $this->sendCategoryCounters($userId, $params);
38 }
39 }
40
41 private function getUsersOnline(array $userIds): array
42 {
43 if (count($userIds) === 1)
44 {
45 return [['ID' => $userIds[0]]];
46 }
47
48 return UserTable::query()
49 ->setSelect(['ID'])
50 ->where('ID', $userIds)
51 ->where('IS_ONLINE', '=', 'Y')
52 ->exec()->fetchAll()
53 ;
54 }
55
56 private function sendCategoryCounters(int $userId, array $fields): void
57 {
58 PushService::addEvent([$userId], [
59 'module_id' => PushService::MODULE_ID,
60 'command' => PushCommandEnum::OPEN_EVENT_SCORER_UPDATED->name,
61 'params' => [
62 'fields' => $fields
63 ],
64 ]);
65 }
66}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getInstance()
Определения application.php:98
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$user
Определения mysql_to_pgsql.php:33
</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
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$fields
Определения yandex_run.php:501