Skip to content

A free open source IT asset/license management system

Only delete user records in accessories_checkouts for bulk delete

snipe5546ab08c295
diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.php
index fcd295ca61..489b2309bf 100644
--- a/app/Http/Controllers/Users/BulkUsersController.php
+++ b/app/Http/Controllers/Users/BulkUsersController.php
@@ -218,8 +218,8 @@ class BulkUsersController extends Controller
}
$users = User::whereIn('id', $user_raw_array)->get();
- $assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', \App\Models\User::class)->get();
- $accessories = DB::table('accessories_checkout')->whereIn('assigned_to', $user_raw_array)->get();
+ $assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', User::class)->get();
+ $accessories = DB::table('accessories_checkout')->where('assigned_type', User::class)->whereIn('assigned_to', $user_raw_array)->get();
$licenses = DB::table('license_seats')->whereIn('assigned_to', $user_raw_array)->get();
$consumables = DB::table('consumables_users')->whereIn('assigned_to', $user_raw_array)->get();