ref #2737 prevent assets with "rtd_location_id" null values to be removed on location sort (#4283)

This commit is contained in:
Nicolai Essig 2017-10-24 03:28:06 +02:00 committed by snipe
parent 0951a756cc
commit 3a302fe2d7

View file

@ -1060,7 +1060,7 @@ class Asset extends Depreciable
*/
public function scopeOrderLocation($query, $order)
{
return $query->join('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order);
return $query->leftJoin('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order);
}