Fix a bug where notifications are send because the end of the maintenance time is set

This commit is contained in:
Nico Stapelbroek
2018-01-21 13:35:30 +01:00
parent e358332048
commit 53142e2c93
2 changed files with 4 additions and 2 deletions

View File

@@ -161,7 +161,9 @@ class Schedule extends Model implements HasPresenter
*/
public function scopeInProgress(Builder $query)
{
return $query->where('scheduled_at', '<=', Carbon::now())->whereNull('completed_at')->where('status', '!=', self::COMPLETE);
return $query->where('scheduled_at', '<=', Carbon::now())->where('status', '!=', self::COMPLETE)->where(function($query) {
$query->whereNull('completed_at')->orWhere('completed_at','>', Carbon::now());
});
}
/**