mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-23 11:43:47 -08:00
updates assets with selected model to inherit asset model eol
This commit is contained in:
parent
57e1df86c8
commit
09b2feac54
|
@ -257,7 +257,7 @@ class LdapSync extends Command
|
|||
|
||||
//If a sync option is not filled in on the LDAP settings don't populate the user field
|
||||
if($ldap_result_username != null){
|
||||
$user->username = $item['username'];
|
||||
$user->username = $item[name'];
|
||||
}
|
||||
if($ldap_result_last_name != null){
|
||||
$user->last_name = $item['lastname'];
|
||||
|
|
|
@ -13,7 +13,7 @@ class RemoveExplicitEols extends Command
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'snipeit:remove-explicit-eols {--model_name=*}';
|
||||
protected $signature = 'snipeit:remove-explicit-eols {--model_name=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
@ -31,11 +31,17 @@ class RemoveExplicitEols extends Command
|
|||
|
||||
if($assetModel){
|
||||
$assets = Asset::where('model_id', '=', $assetModel->id)->get();
|
||||
|
||||
foreach ($assets as $asset) {
|
||||
$asset->eol_explicit = 0;
|
||||
$asset->asset_eol_date = null;
|
||||
$asset->save();
|
||||
}
|
||||
|
||||
$this->info($assets->count().' Assets updated successfully');
|
||||
}
|
||||
else {
|
||||
$this->error('Asset model not found');
|
||||
}
|
||||
|
||||
dd($assets);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue