File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
app/Http/Controllers/Admin
resources/views/admin/databases Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,7 @@ public function getIndex(Request $request)
4848 {
4949 return view ('admin.databases.index ' , [
5050 'databases ' => Models \Database::with ('server ' )->paginate (50 ),
51- 'hosts ' => Models \DatabaseServer::select (
52- 'database_servers.* ' ,
53- DB ::raw ('(SELECT COUNT(*) FROM `databases` WHERE `databases`.`db_server` = database_servers.id) as c_databases ' )
54- )->with ('node ' )->paginate (20 ),
51+ 'hosts ' => Models \DatabaseServer::withCount ('databases ' )->with ('node ' )->paginate (20 ),
5552 ]);
5653 }
5754
Original file line number Diff line number Diff line change 9292 <td >{{ $database -> name } } </td >
9393 <td ><code >{{ $database -> host } } :{{ $database -> port } } </code ></td >
9494 <td >{{ $database -> username } } </td >
95- <td class =" text-center" >{{ $database -> c_databases } } </td >
95+ <td class =" text-center" >{{ $database -> databases_count } } </td >
9696 <td >@if (is_null ($database -> node ) )<em >unlinked</em >@else {{ $database -> node -> name } }@endif </td >
9797 <td class =" text-center" ><a href =" #" class =" text-danger" data-action =" delete" data-type =" delete-server" data-attr =" {{ $database -> id } }" ><i class =" fa fa-trash-o" ></i ></a ></td >
9898 </tr >
You can’t perform that action at this time.
0 commit comments