5use \Bitrix\Main\Entity;
6use \Bitrix\Main\Type\DateTime;
7use \Bitrix\Landing\Manager;
8use \Bitrix\Landing\Landing;
9use \Bitrix\Landing\Rights;
10use \Bitrix\Landing\Internals\ViewTable;
11use \Bitrix\Landing\Controller;
28 $res = ViewTable::getList([
37 'SUM',
'SUM(%s)', [
'VIEWS']
41 if ($row = $res->fetch())
45 'VIEWS' => $row[
'SUM'],
46 'DATE_MODIFY' =>
false
58 public static function inc($lid, $uid =
null)
72 if (!isset($_SESSION[self::SESSION_VIEWS_KEY]))
77 if (!in_array($lid, $_SESSION[self::SESSION_VIEWS_KEY]))
79 $res = ViewTable::getList([
88 if ($row = $res->fetch())
90 $result = ViewTable::update($row[
'ID'], [
91 'VIEWS' => $row[
'VIEWS'] + 1,
97 $result = ViewTable::add([
101 'FIRST_VIEW' => $date,
102 'LAST_VIEW' => $date,
105 if ($result->isSuccess())
116 $res = ViewTable::getList([
130 if ($row = $res->fetch())
132 $views = (int)$row[
'COUNT'];
135 if (isset($views) && is_int($views))
145 $res = ViewTable::getList([
154 while ($row = $res->fetch())
156 $data[
'id'][] = $row[
'USER_ID'];
158 $usersInfo = Controller\User::getUsersInfoAction($data[
'id']);
159 $data[
'name'] = $usersInfo[
'name'];
160 $countUsers = count($usersInfo[
'name']);
161 for ($i = 0; $i < $countUsers; $i++)
163 if ($usersInfo[
'personalPhoto'][$i])
165 $avatar = \CFile::ResizeImageGet(
166 $usersInfo[
'personalPhoto'][$i],
167 [
'width' => 58,
'height' => 58],
168 BX_RESIZE_IMAGE_EXACT
171 if (isset($avatar[
'src']))
173 $data[
'avatar'][] = $avatar[
'src'];
177 $data[
'avatar'][] =
'';
static getUniqueUserData(int $lid)
static incViewsPage($lid)
static getNumberUniqueViews(int $lid)
static inc($lid, $uid=null)
static update($id, $fields=array())