Cleanup database query code.
This commit is contained in:
parent
99812b0407
commit
0720bfe62f
2 changed files with 2 additions and 5 deletions
|
@ -48,10 +48,7 @@ class DatabaseController extends Controller
|
|||
{
|
||||
return view('admin.databases.index', [
|
||||
'databases' => Models\Database::with('server')->paginate(50),
|
||||
'hosts' => Models\DatabaseServer::select(
|
||||
'database_servers.*',
|
||||
DB::raw('(SELECT COUNT(*) FROM `databases` WHERE `databases`.`db_server` = database_servers.id) as c_databases')
|
||||
)->with('node')->paginate(20),
|
||||
'hosts' => Models\DatabaseServer::withCount('databases')->with('node')->paginate(20),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue