Fixes #2875 - use leftJoin so as to not filter out unassigned assets when sorting by assigned

This commit is contained in:
snipe 2016-11-11 20:50:10 -08:00
parent 369715b7c7
commit cbabcb9197

View file

@ -870,7 +870,7 @@ public function checkin_email()
*/ */
public function scopeOrderAssigned($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);
} }
/** /**