diff --git a/app/Models/Asset.php b/app/Models/Asset.php index c716b77d1e..e3d17d5e35 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1566,7 +1566,7 @@ class Asset extends Depreciable */ public function scopeOrderModelNumber($query, $order) { - return $query->leftJoin('models as model_number_sort', 'assets.model_id', '=', 'models.id')->orderBy('models.model_number', $order); + return $query->leftJoin('models as model_number_sort', 'assets.model_id', '=', 'model_number_sort.id')->orderBy('model_number_sort.model_number', $order); }