Use table alias for models join in search/order by models

This commit is contained in:
snipe 2017-11-14 00:04:03 -08:00
parent 0396267388
commit 3e5e6ba99a

View file

@ -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);
}
/**