Minor fixes for backup update

This commit is contained in:
David Bomba 2022-03-05 17:51:04 +11:00
parent 9ab15426eb
commit 10ef13fb9e
2 changed files with 8 additions and 3 deletions

View File

@ -77,8 +77,8 @@ class BackupUpdate extends Command
{ {
set_time_limit(0); set_time_limit(0);
Backup::whereRaw('html_backup IS NOT NULL')->chunk(5000, function ($backups) { Backup::whereHas('activity')->whereRaw('html_backup IS NOT NULL')->cursor()->each( function ($backup) {
foreach ($backups as $backup) {
if(strlen($backup->html_backup) > 1 && $backup->activity->invoice->exists()){ if(strlen($backup->html_backup) > 1 && $backup->activity->invoice->exists()){
@ -97,7 +97,7 @@ class BackupUpdate extends Command
} }
}
}); });
} }

View File

@ -177,6 +177,11 @@ class Activity extends StaticModel
return $this->belongsTo(Invoice::class)->withTrashed(); return $this->belongsTo(Invoice::class)->withTrashed();
} }
public function credit()
{
return $this->belongsTo(Credit::class)->withTrashed();
}
/** /**
* @return mixed * @return mixed
*/ */