mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 09:04:09 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
581e56198c
|
@ -46,6 +46,7 @@ class AssetModelsController extends Controller
|
||||||
'requestable',
|
'requestable',
|
||||||
'assets_count',
|
'assets_count',
|
||||||
'category',
|
'category',
|
||||||
|
'fieldset',
|
||||||
];
|
];
|
||||||
|
|
||||||
$assetmodels = AssetModel::select([
|
$assetmodels = AssetModel::select([
|
||||||
|
@ -94,6 +95,9 @@ class AssetModelsController extends Controller
|
||||||
case 'category':
|
case 'category':
|
||||||
$assetmodels->OrderCategory($order);
|
$assetmodels->OrderCategory($order);
|
||||||
break;
|
break;
|
||||||
|
case 'fieldset':
|
||||||
|
$assetmodels->OrderFieldset($order);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$assetmodels->orderBy($sort, $order);
|
$assetmodels->orderBy($sort, $order);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -291,4 +291,9 @@ class AssetModel extends SnipeModel
|
||||||
{
|
{
|
||||||
return $query->leftJoin('categories', 'models.category_id', '=', 'categories.id')->orderBy('categories.name', $order);
|
return $query->leftJoin('categories', 'models.category_id', '=', 'categories.id')->orderBy('categories.name', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeOrderFieldset($query, $order)
|
||||||
|
{
|
||||||
|
return $query->leftJoin('custom_fieldsets', 'models.fieldset_id', '=', 'custom_fieldsets.id')->orderBy('custom_fieldsets.name', $order);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue