diff --git a/app/Console/Commands/PopulateAcademyCourseEnrollments.php b/app/Console/Commands/PopulateAcademyCourseEnrollments.php index 7469057..2571837 100644 --- a/app/Console/Commands/PopulateAcademyCourseEnrollments.php +++ b/app/Console/Commands/PopulateAcademyCourseEnrollments.php @@ -103,6 +103,11 @@ public function handle() } } + if ($e->status < AcademyCourseEnrollment::$STATUS_COMPLETED && $user->rating >= $e->course->rating) { + $e->status = AcademyCourseEnrollment::$STATUS_EXEMPT; + $hasChange = true; + } + if ($hasChange) { $e->save(); }