Fix download sort

This commit is contained in:
2026-06-29 19:35:53 +02:00
parent 1bc89691d9
commit 3cb98ce542

View File

@@ -332,7 +332,7 @@ class Database extends Component
$sortColumn = $this->sortBy; $sortColumn = $this->sortBy;
if ($sortColumn === 'total_downloads') { if ($sortColumn === 'total_downloads') {
$sortColumn = 'files_sum_download_count'; return $query->orderByRaw('COALESCE(files_sum_download_count, 0) + old_download_count ' . $this->sortDir);
} }
return $query->orderBy($sortColumn, $this->sortDir); return $query->orderBy($sortColumn, $this->sortDir);