mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Fix extraneous wildcard query in requestable asset search
This commit is contained in:
parent
4e3fd6bfaf
commit
4e8ae8a162
|
@ -942,7 +942,9 @@ class AssetsController extends Controller
|
|||
$offset = request('offset', 0);
|
||||
$limit = $request->input('limit', 50);
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
$assets->TextSearch($request->input('search'));
|
||||
if ($request->filled('search')) {
|
||||
$assets->TextSearch($request->input('search'));
|
||||
}
|
||||
|
||||
switch ($request->input('sort')) {
|
||||
case 'model':
|
||||
|
|
|
@ -57,10 +57,10 @@ class ViewAssetsController extends Controller
|
|||
*/
|
||||
public function getRequestableIndex()
|
||||
{
|
||||
$assets = Asset::with('model', 'defaultLoc', 'location', 'assignedTo', 'requests')->Hardware()->RequestableAssets();
|
||||
$asset_count = Asset::with('model', 'defaultLoc', 'location', 'assignedTo', 'requests')->Hardware()->RequestableAssets()->count();
|
||||
$models = AssetModel::with('category', 'requests', 'assets')->RequestableModels()->get();
|
||||
|
||||
return view('account/requestable-assets', compact('assets', 'models'));
|
||||
return view('account/requestable-assets', compact('asset_count', 'models'));
|
||||
}
|
||||
|
||||
public function getRequestItem(Request $request, $itemType, $itemId = null)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#assets" data-toggle="tab" title="{{ trans('general.assets') }}">{{ trans('general.assets') }}
|
||||
<badge class="badge badge-secondary"> {{ $assets->count()}}</badge>
|
||||
<badge class="badge badge-secondary"> {{ $asset_count }}</badge>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
|
Loading…
Reference in a new issue