Tracking: fix student list to calculate the statistics on followed users, fix to commit d19450c29d - refs BT#21814

pull/5783/head
NicoDucou 1 year ago
parent d4b511d2e9
commit ac9c1cb5be
  1. 19
      main/inc/lib/tracking.lib.php

@ -2394,7 +2394,7 @@ class Tracking
null, null,
null, null,
null, null,
$getCount false
); );
} else { } else {
$studentList = UserManager::getUsersFollowedByUser( $studentList = UserManager::getUsersFollowedByUser(
@ -2402,7 +2402,7 @@ class Tracking
STUDENT, STUDENT,
false, false,
false, false,
$getCount, false,
null, null,
null, null,
null, null,
@ -2415,16 +2415,15 @@ class Tracking
); );
} }
if ($getCount) { $students = [];
$studentCount = (int) $studentList; if (is_array($studentList)) {
} else { foreach ($studentList as $studentData) {
$students = []; $students[] = $studentData['user_id'];
if (is_array($studentList)) {
foreach ($studentList as $studentData) {
$students[] = $studentData['user_id'];
}
} }
} }
if ($getCount) {
$studentCount = count($students);
}
$studentBossesList = UserManager::getUsersFollowedByUser( $studentBossesList = UserManager::getUsersFollowedByUser(
$userId, $userId,

Loading…
Cancel
Save