fix: remove success application deployment job
wip: daily backup status
This commit is contained in:
@@ -65,7 +65,8 @@ class Application extends BaseModel
|
||||
return $this->belongsToMany(StandaloneDocker::class, 'additional_destinations')
|
||||
->withPivot('server_id', 'status');
|
||||
}
|
||||
public function is_public_repository(): bool {
|
||||
public function is_public_repository(): bool
|
||||
{
|
||||
if (data_get($this, 'source.is_public')) {
|
||||
return true;
|
||||
}
|
||||
@@ -401,7 +402,10 @@ class Application extends BaseModel
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_last_days_deployments()
|
||||
{
|
||||
return ApplicationDeploymentQueue::where('application_id', $this->id)->where('created_at', '>=', now()->subDays(7))->orderBy('created_at', 'desc')->get();
|
||||
}
|
||||
public function deployments(int $skip = 0, int $take = 10)
|
||||
{
|
||||
$deployments = ApplicationDeploymentQueue::where('application_id', $this->id)->orderBy('created_at', 'desc');
|
||||
|
||||
@@ -30,4 +30,8 @@ class ScheduledDatabaseBackup extends BaseModel
|
||||
{
|
||||
return $this->belongsTo(S3Storage::class, 's3_storage_id');
|
||||
}
|
||||
public function get_last_days_backup_status($days = 7)
|
||||
{
|
||||
return $this->hasMany(ScheduledDatabaseBackupExecution::class)->where('created_at', '>=', now()->subDays($days))->get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user