Use left join, not inner here

This commit is contained in:
Dane Everitt 2018-02-17 15:52:41 -06:00
parent 7562e501af
commit f61a5fa0cb
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -173,7 +173,7 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa
$instance = $this->getBuilder() $instance = $this->getBuilder()
->select(['nodes.id', 'nodes.memory', 'nodes.disk', 'nodes.memory_overallocate', 'nodes.disk_overallocate']) ->select(['nodes.id', 'nodes.memory', 'nodes.disk', 'nodes.memory_overallocate', 'nodes.disk_overallocate'])
->selectRaw('IFNULL(SUM(servers.memory), 0) as sum_memory, IFNULL(SUM(servers.disk), 0) as sum_disk') ->selectRaw('IFNULL(SUM(servers.memory), 0) as sum_memory, IFNULL(SUM(servers.disk), 0) as sum_disk')
->join('servers', 'servers.node_id', '=', 'nodes.id') ->leftJoin('servers', 'servers.node_id', '=', 'nodes.id')
->where('nodes.public', 1); ->where('nodes.public', 1);
if (! empty($locations)) { if (! empty($locations)) {