Skip to content

Commit

Permalink
Merge pull request #306 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
PleaseWork
  • Loading branch information
JoshuaMicallefYBSU authored Aug 18, 2024
2 parents 3f03157 + d2227d8 commit e8d2506
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function schedule(Schedule $schedule)
$schedule->job(new ProcessSessionReminders())->daily();

// Check Training Threads Status (Once per week)
$schedule->job(new DiscordTrainingUpdates())->weeklyOn(7, '19:10');
$schedule->job(new DiscordTrainingUpdates())->weeklyOn(7, '19:28');

// Discord role updating
//$schedule->job(new UpdateDiscordUserRoles)->twiceDaily(6, 18);
Expand Down
12 changes: 6 additions & 6 deletions app/Jobs/DiscordTrainingUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function handle()
}

// See if CID is still a student
$student = Student::where('current', 1)->where('user_id', $cid)->firstOrFail();
$student = Student::where('current', 1)->where('user_id', $cid)->first();

if($student !== null){

Expand Down Expand Up @@ -102,11 +102,11 @@ public function handle()

// See if user is still a student
if($cid !== null){
$student = Student::where('current', 1)->where('user_id', $cid)->firstOrFail();
// Check Lable is 'In Progress' or 'Ready For Pick-Up'
if($student->hasLabel('In Progress') || $student->hasLabel('Ready For Pick-Up')){

$student = Student::whereCurrent(true)->where('user_id', $cid)->firstOrFail();

//Is student already ready for assessment?
if ($student && ($student->hasLabel('In Progress') !== false || $student->hasLabel('Ready For Pick-Up') !== false)) {
// Check Sessions Upcoming
$upcoming_sessions = TrainingSession::where('student_id', $student->id)->whereBetween('scheduled_time', [Carbon::now(), Carbon::now()->addDays(7)])->first();

Expand Down

0 comments on commit e8d2506

Please sign in to comment.