From 3e5e6ba99a931079b355f771ffefea99da7fd20d Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 14 Nov 2017 00:04:03 -0800 Subject: [PATCH] Use table alias for models join in search/order by models --- 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 3ef3f14833..df95964d34 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', 'assets.model_id', '=', 'models.id')->orderBy('models.name', $order); + return $query->join('models as asset_models', 'assets.model_id', '=', 'models.id')->orderBy('models.name', $order); } /**