diff --git a/app/Http/Controllers/Api/CompaniesController.php b/app/Http/Controllers/Api/CompaniesController.php index ebafd9a98..f1e578705 100644 --- a/app/Http/Controllers/Api/CompaniesController.php +++ b/app/Http/Controllers/Api/CompaniesController.php @@ -35,10 +35,7 @@ class CompaniesController extends Controller 'components_count', ]; - $companies = Company::withCount('assets','licenses','accessories','consumables','components','users') - ->withCount('users')->withCount('assets') - ->withCount('licenses')->withCount('accessories') - ->withCount('consumables')->withCount('components'); + $companies = Company::withCount('assets','licenses','accessories','consumables','components','users'); if ($request->has('search')) { $companies->TextSearch($request->input('search')); diff --git a/app/Models/Company.php b/app/Models/Company.php index a0b18c3b1..76260311f 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -166,31 +166,31 @@ final class Company extends SnipeModel public function users() { - return $this->hasMany(User::class, 'users.company_id'); + return $this->hasMany(User::class, 'company_id'); } public function assets() { - return $this->hasMany(Asset::class, 'assets.company_id'); + return $this->hasMany(Asset::class, 'company_id'); } public function licenses() { - return $this->hasMany(License::class, 'licenses.company_id'); + return $this->hasMany(License::class, 'company_id'); } public function accessories() { - return $this->hasMany(Accessory::class, 'accessories.company_id'); + return $this->hasMany(Accessory::class, 'company_id'); } public function consumables() { - return $this->hasMany(Consumable::class, 'consumables.company_id'); + return $this->hasMany(Consumable::class, 'company_id'); } public function components() { - return $this->hasMany(Component::class, 'components.company_id'); + return $this->hasMany(Component::class, 'company_id'); } /** diff --git a/config/version.php b/config/version.php index 86c775a4c..0f9b5ecc0 100644 --- a/config/version.php +++ b/config/version.php @@ -1,8 +1,8 @@ 'v4.1.8', - 'full_app_version' => 'v4.1.8-pre - build 3106-geb827cd', - 'build_version' => '3106', + 'app_version' => 'v4.1.9-pre', + 'full_app_version' => 'v4.1.9-pre - build 3117-', + 'build_version' => '3117', 'prerelease_version' => '', 'hash_version' => 'geb827cd', 'full_hash' => 'v4.1.7-69-geb827cd',