1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

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);
Backup::whereRaw('html_backup IS NOT NULL')->chunk(5000, function ($backups) {
foreach ($backups as $backup) {
Backup::whereHas('activity')->whereRaw('html_backup IS NOT NULL')->cursor()->each( function ($backup) {
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();
}
public function credit()
{
return $this->belongsTo(Credit::class)->withTrashed();
}
/**
* @return mixed
*/