mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Fixes #4639
This commit is contained in:
parent
9a40e5e651
commit
7a8c8233a2
|
@ -35,10 +35,7 @@ class CompaniesController extends Controller
|
||||||
'components_count',
|
'components_count',
|
||||||
];
|
];
|
||||||
|
|
||||||
$companies = Company::withCount('assets','licenses','accessories','consumables','components','users')
|
$companies = Company::withCount('assets','licenses','accessories','consumables','components','users');
|
||||||
->withCount('users')->withCount('assets')
|
|
||||||
->withCount('licenses')->withCount('accessories')
|
|
||||||
->withCount('consumables')->withCount('components');
|
|
||||||
|
|
||||||
if ($request->has('search')) {
|
if ($request->has('search')) {
|
||||||
$companies->TextSearch($request->input('search'));
|
$companies->TextSearch($request->input('search'));
|
||||||
|
|
|
@ -166,31 +166,31 @@ final class Company extends SnipeModel
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
return $this->hasMany(User::class, 'users.company_id');
|
return $this->hasMany(User::class, 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assets()
|
public function assets()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Asset::class, 'assets.company_id');
|
return $this->hasMany(Asset::class, 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function licenses()
|
public function licenses()
|
||||||
{
|
{
|
||||||
return $this->hasMany(License::class, 'licenses.company_id');
|
return $this->hasMany(License::class, 'company_id');
|
||||||
}
|
}
|
||||||
public function accessories()
|
public function accessories()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Accessory::class, 'accessories.company_id');
|
return $this->hasMany(Accessory::class, 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function consumables()
|
public function consumables()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Consumable::class, 'consumables.company_id');
|
return $this->hasMany(Consumable::class, 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function components()
|
public function components()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Component::class, 'components.company_id');
|
return $this->hasMany(Component::class, 'company_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue