From 3ce0a601ff836b15c4e2a567ac444161e089cc19 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 27 Jan 2023 11:39:27 +1100 Subject: [PATCH] Minor checks for user deleted_at state --- app/Console/Commands/CheckData.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 1b3857ff72a9..038d78e8374c 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -126,7 +126,8 @@ class CheckData extends Command $this->checkVendorSettings(); $this->checkClientSettings(); $this->checkCompanyTokens(); - + $this->checkUserState(); + if(Ninja::isHosted()){ $this->checkAccountStatuses(); $this->checkNinjaPortalUrls(); @@ -414,6 +415,16 @@ class CheckData extends Command } } + private function checkUserState() + { + User::withTrashed() + ->where('deleted_at', '0000-00-00 00:00:00.000000') + ->cursor() + ->each(function ($user){ + $user->restore(); + }); + } + private function checkEntityInvitations() {