mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -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
|
//updates assets location based on user's location
|
||||||
$assets = Asset::where('assigned_to', '=', $user->id)->get();
|
Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]);
|
||||||
foreach($assets as $asset){
|
|
||||||
$asset->location_id = $user->location_id;
|
|
||||||
$asset->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$user->ldap_import = 1;
|
$user->ldap_import = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue