From 3d07635820d1aae6adb2d0f430beb6330f641740 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 16 Nov 2017 14:14:30 -0800 Subject: [PATCH] Fixed sort by model in asset listing --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index df95964d34..a8d0035b7a 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -963,7 +963,7 @@ class Asset extends Depreciable */ public function scopeOrderModels($query, $order) { - return $query->join('models as asset_models', 'assets.model_id', '=', 'models.id')->orderBy('models.name', $order); + return $query->join('models as asset_models', 'assets.model_id', '=', 'asset_models.id')->orderBy('asset_models.name', $order); } /**