71 isset($fields[
'userId'])
72 ? intval($fields[
'userId'])
77 isset($fields[
'limit'])
78 ? intval($fields[
'limit'])
82 $intranetInstalled = Loader::includeModule(
'intranet');
84 $res = UserWelltoryTable::getList([
89 'DATE_MEASURE' =>
'desc'
91 'select' => [
'ID',
'DATE_MEASURE',
'STRESS',
'STRESS_TYPE',
'STRESS_COMMENT',
'HASH' ],
94 while ($dataFields = $res->fetch())
97 'id' => $dataFields[
'ID'],
98 'date' => $dataFields[
'DATE_MEASURE'],
99 'value' => intval($dataFields[
'STRESS']),
100 'type' => ($dataFields[
'STRESS_TYPE'] <>
'' ? $dataFields[
'STRESS_TYPE'] :
''),
101 'typeDescription' => ($intranetInstalled ? :
''),
102 'comment' => ($dataFields[
'STRESS_COMMENT'] <>
'' ? $dataFields[
'STRESS_COMMENT'] :
''),
103 'hash' => ($dataFields[
'HASH'] <>
'' ? $dataFields[
'HASH'] :
'')
105 $item[
'typeDescription'] = ($intranetInstalled ? \Bitrix\Intranet\Component\UserProfile\StressLevel::getTypeDescription($item[
'type'], $item[
'value']) :
'');