mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-66970 analytics: Fix incorrect use of ??
This commit is contained in:
parent
aaff6692a1
commit
b00d35a6fc
@ -302,8 +302,20 @@ abstract class course_enrolments extends \core_analytics\local\target\binary {
|
||||
protected function enrolment_active_during_analysis_time(int $sampleid, int $starttime, int $endtime) {
|
||||
|
||||
$userenrol = $this->retrieve('user_enrolments', $sampleid);
|
||||
$enrolstart = $userenrol->timestart ?? $userenrol->timecreated;
|
||||
$enrolend = $userenrol->timeend ?? PHP_INT_MAX;
|
||||
|
||||
if (!empty($userenrol->timestart)) {
|
||||
$enrolstart = $userenrol->timestart;
|
||||
} else {
|
||||
// This is always set.
|
||||
$enrolstart = $userenrol->timecreated;
|
||||
}
|
||||
|
||||
if (!empty($userenrol->timeend)) {
|
||||
$enrolend = $userenrol->timeend;
|
||||
} else {
|
||||
// Default to tre end of the world.
|
||||
$enrolend = PHP_INT_MAX;
|
||||
}
|
||||
|
||||
if ($endtime && $endtime < $enrolstart) {
|
||||
/* The enrolment starts/ed after the analysis end time.
|
||||
|
Loading…
x
Reference in New Issue
Block a user