diff --git a/app/models/Asset.php b/app/models/Asset.php index 685fc2f4a6..f45e1bc626 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -79,7 +79,11 @@ class Asset extends Elegant { */ public static function assetcount() { - return Asset::where('physical', '==', 1)->count(); + return DB::table('assets') + + ->where('physical', '=', '1') + ->whereNull('deleted_at','and') + ->count(); } /** @@ -87,9 +91,13 @@ class Asset extends Elegant { */ public static function availassetcount() { - return Asset::where('assigned_to', '==', 0)->count(); + return DB::table('assets') + ->where('physical', '=', '1') + ->where('assigned_to', '=', '0') + ->whereNull('deleted_at','and') + ->count(); + } - } diff --git a/app/models/License.php b/app/models/License.php index f615c7bd2a..85325e3f57 100644 --- a/app/models/License.php +++ b/app/models/License.php @@ -50,7 +50,10 @@ class License extends Elegant { */ public static function assetcount() { - return Asset::where('physical', '==', 1)->count(); + return DB::table('assets') + ->where('physical', '=', '0') + ->whereNull('deleted_at','and') + ->count(); } /** @@ -58,7 +61,12 @@ class License extends Elegant { */ public static function availassetcount() { - return Asset::where('assigned_to', '==', 0)->count(); + return DB::table('assets') + ->where('physical', '=', '0') + ->where('assigned_to', '=', '0') + ->whereNull('deleted_at','and') + ->count(); + } diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index b93797707f..1fe9904eb7 100755 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -221,7 +221,7 @@
{{ number_format(License::assetcount()) }} - licenses + total licenses
(placeholder)
@@ -229,7 +229,7 @@
{{ number_format(License::availassetcount()) }} - people + licenses available
(placeholder)