mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added some debugging
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e2fd5199c3
commit
004d567253
|
@ -41,11 +41,16 @@ class MergeUsersByUsername extends Command
|
||||||
{
|
{
|
||||||
// Get the list of users who have an email address as their username
|
// Get the list of users who have an email address as their username
|
||||||
$users = User::where('username', 'LIKE', '%@%')->whereNull('deleted_at')->get();
|
$users = User::where('username', 'LIKE', '%@%')->whereNull('deleted_at')->get();
|
||||||
|
$this->info($users->count().' total non-deleted users whose usernames contain a @ symbol.');
|
||||||
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$parts = explode('@', $user->username);
|
$parts = explode('@', $user->username);
|
||||||
$bad_users = User::where('username', '=', $parts[0])->whereNull('deleted_at')->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')->get();
|
$bad_users = User::where('username', '=', $parts[0])->whereNull('deleted_at')->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')->get();
|
||||||
|
|
||||||
|
$this->info($bad_users->count().' total non-deleted users whose usernames DO NOT contain a @ symbol.');
|
||||||
|
|
||||||
|
|
||||||
foreach ($bad_users as $bad_user) {
|
foreach ($bad_users as $bad_user) {
|
||||||
$this->info($bad_user->username.' ('.$bad_user->id.') will be merged into '.$user->username.' ('.$user->id.') ');
|
$this->info($bad_user->username.' ('.$bad_user->id.') will be merged into '.$user->username.' ('.$user->id.') ');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue