From 7a8c8233a286ca096fff9bba94391c554e5252ce Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 15 Dec 2017 18:54:38 -0800 Subject: [PATCH 1/2] Fixes #4639 --- app/Http/Controllers/Api/CompaniesController.php | 5 +---- app/Models/Company.php | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) 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'); } /** From 30716b349bcd03fcd23e6fb48d408975ad12f5f3 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 15 Dec 2017 18:55:56 -0800 Subject: [PATCH 2/2] Bumped dev hash --- config/version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index 86a96ae47..82d28c311 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ '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', + 'hash_version' => '', + 'full_hash' => 'v4.1.8', 'branch' => 'develop', );