mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 13:14:07 -08:00
Fixed sorting issue in asset models when ordering by manufacturer
This commit is contained in:
parent
e44e573a3c
commit
02720f225c
|
@ -55,7 +55,7 @@ class AssetModelsController extends Controller
|
||||||
$assetmodels->OrderManufacturer($order);
|
$assetmodels->OrderManufacturer($order);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$assetmodels->orderBy($sort, $order);
|
$assetmodels->orderBy('models'.$sort, $order);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ class AssetModel extends SnipeModel
|
||||||
public function scopeTextSearch($query, $search)
|
public function scopeTextSearch($query, $search)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $query->where('name', 'LIKE', "%$search%")
|
return $query->where('models.name', 'LIKE', "%$search%")
|
||||||
->orWhere('model_number', 'LIKE', "%$search%")
|
->orWhere('model_number', 'LIKE', "%$search%")
|
||||||
->orWhere(function ($query) use ($search) {
|
->orWhere(function ($query) use ($search) {
|
||||||
$query->whereHas('depreciation', function ($query) use ($search) {
|
$query->whereHas('depreciation', function ($query) use ($search) {
|
||||||
|
|
Loading…
Reference in a new issue