fix server workers 500 error

This commit is contained in:
Saeed Vaziry
2025-03-16 14:38:10 +01:00
parent 7886e2a113
commit f89e7af34e
3 changed files with 12 additions and 10 deletions

View File

@ -44,8 +44,10 @@ protected function getTableQuery(): Builder
return Worker::query()
->where('server_id', $this->server->id)
->where(function (Builder $query): void {
if ($this->site instanceof \App\Models\Site) {
if ($this->site instanceof Site) {
$query->where('site_id', $this->site->id);
} else {
$query->whereNull('site_id');
}
});
}