mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
replaced for loop with eloquent query update
This commit is contained in:
parent
866f0a9f56
commit
c62a022252
|
@ -392,11 +392,7 @@ class LdapSync extends Command
|
|||
}
|
||||
}
|
||||
//updates assets location based on user's location
|
||||
$assets = Asset::where('assigned_to', '=', $user->id)->get();
|
||||
foreach($assets as $asset){
|
||||
$asset->location_id = $user->location_id;
|
||||
$asset->save();
|
||||
}
|
||||
Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]);
|
||||
|
||||
$user->ldap_import = 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue