mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-27 06:29:47 -08:00
Added table aliases to fix ambiguous SQL clause
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
b78aba787f
commit
c7106a1df2
|
@ -1641,9 +1641,9 @@ class Asset extends Depreciable
|
||||||
*/
|
*/
|
||||||
public function scopeOrderManufacturer($query, $order)
|
public function scopeOrderManufacturer($query, $order)
|
||||||
{
|
{
|
||||||
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
return $query->join('models as order_asset_model', 'assets.model_id', '=', 'order_asset_model.id')
|
||||||
->join('manufacturers', 'models.manufacturer_id', '=', 'manufacturers.id')
|
->join('manufacturers as manufacturer_order', 'order_asset_model.manufacturer_id', '=', 'manufacturer_order.id')
|
||||||
->orderBy('manufacturers.name', $order);
|
->orderBy('manufacturer_order.name', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue