mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Set table alias for model number sort scope
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
8c6bde335e
commit
4f7b2836b5
|
@ -1566,7 +1566,7 @@ class Asset extends Depreciable
|
|||
*/
|
||||
public function scopeOrderModelNumber($query, $order)
|
||||
{
|
||||
return $query->join('models', 'assets.model_id', '=', 'models.id')->orderBy('models.model_number', $order);
|
||||
return $query->leftJoin('models as model_number_sort', 'assets.model_id', '=', 'models.id')->orderBy('models.model_number', $order);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue