Skip to content

Commit

Permalink
Fixes #2875 - use leftJoin so as to not filter out unassigned assets …
Browse files Browse the repository at this point in the history
…when sorting by assigned
  • Loading branch information
snipe committed Nov 12, 2016
1 parent 369715b commit cbabcb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/Asset.php
Expand Up @@ -870,7 +870,7 @@ public function scopeOrderModelNumber($query, $order)
*/
public function scopeOrderAssigned($query, $order)
{
return $query->join('users', 'assets.assigned_to', '=', 'users.id')->orderBy('users.first_name', $order)->orderBy('users.last_name', $order);
return $query->leftJoin('users', 'assets.assigned_to', '=', 'users.id')->select('assets.*')->orderBy('users.first_name', $order)->orderBy('users.last_name', $order);
}

/**
Expand Down

0 comments on commit cbabcb9

Please sign in to comment.