mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-25 00:50:32 +00:00
update
This commit is contained in:
parent
ccbbdefda1
commit
3fc7ea370a
2 changed files with 11 additions and 0 deletions
|
@ -66,6 +66,9 @@ class CronJobResource extends Resource
|
|||
Tables\Columns\TextColumn::make('user')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('hostingSubscription.domain')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
|
|
|
@ -12,6 +12,7 @@ class CronJob extends Model
|
|||
'schedule',
|
||||
'command',
|
||||
'user',
|
||||
'hosting_subscription_id'
|
||||
];
|
||||
|
||||
protected static function booted(): void
|
||||
|
@ -35,6 +36,12 @@ class CronJob extends Model
|
|||
parent::boot();
|
||||
|
||||
static::creating(function ($model) {
|
||||
if ($model->hosting_subscription_id) {
|
||||
$hostingSubscription = HostingSubscription::where('id', $model->hosting_subscription_id)->first();
|
||||
if ($hostingSubscription) {
|
||||
$model->user = $hostingSubscription->system_username;
|
||||
}
|
||||
}
|
||||
$allCronJobs = [];
|
||||
$oldCronJobs = self::where('user', $model->user)->get();
|
||||
foreach ($oldCronJobs as $oldCronJob) {
|
||||
|
@ -101,4 +108,5 @@ class CronJob extends Model
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue