A free open source IT asset/license management system
Added table alias for sorting
snipecf56f70b3a7f
diff --git a/app/Models/Asset.php b/app/Models/Asset.phpindex bcb702341b..578a776371 100644--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@ -1085,7 +1085,7 @@ class Asset extends Depreciable*/public function scopeOrderLocation($query, $order){- return $query->leftJoin('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order);+ return $query->leftJoin('locations as asset_locations', 'asset_locations.id', '=', 'assets.rtd_location_id')->orderBy('asset_locations.name', $order);}@@ -1099,7 +1099,7 @@ class Asset extends Depreciable*/public function scopeOrderSupplier($query, $order){- return $query->leftJoin('suppliers', 'assets.supplier_id', '=', 'suppliers.id')->orderBy('suppliers.name', $order);+ return $query->leftJoin('suppliers as suppliers_assets', 'assets.supplier_id', '=', 'suppliers_assets.id')->orderBy('suppliers_assets.name', $order);}/**