mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Merge pull request #13200 from snipe/bug/sc-23417
Set table alias for model number sort scope
This commit is contained in:
commit
49b50d81ee
|
@ -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