diff --git a/app/models/License.php b/app/models/License.php index a2d30b160b..d2a2f8959b 100755 --- a/app/models/License.php +++ b/app/models/License.php @@ -112,12 +112,16 @@ class License extends Elegant */ public function assignedcount() { - return DB::table('license_seats') - ->whereNotNull('assigned_to') - ->whereNotNull('asset_id') - ->where('license_id', '=', $this->id) - ->whereNull('deleted_at') - ->count(); + + return LicenseSeat::where('license_id', '=', $this->id) + ->where( function ( $query ) + { + $query->whereNotNull('assigned_to') + ->orWhereNotNull('asset_id'); + }) + ->count(); + + } public function remaincount() @@ -125,7 +129,6 @@ class License extends Elegant $total = $this->totalSeatsByLicenseID(); $taken = $this->assignedcount(); $diff = ($total - $taken); - return $diff; } diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 57763c45f9..91f0a23203 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -143,9 +143,9 @@ @endif - @if ($asset->deleted_at=='') +