diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 23a38601787b..d0e6ec2a74c9 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -69,8 +69,10 @@ class Kernel extends ConsoleKernel } if(config('queue.default') == 'database' && Ninja::isSelfHost()) { + $schedule->command('queue:work')->everyMinute()->withoutOverlapping(); $schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping(); + } } diff --git a/app/Http/Middleware/CheckClientExistence.php b/app/Http/Middleware/CheckClientExistence.php index e13f6a2c380f..3b6802788a9a 100644 --- a/app/Http/Middleware/CheckClientExistence.php +++ b/app/Http/Middleware/CheckClientExistence.php @@ -32,11 +32,14 @@ class CheckClientExistence ->where('email', auth('contact')->user()->email) ->whereNotNull('email') ->distinct('company_id') + ->whereNotNull('company_id') ->whereHas('client', function ($query) { return $query->whereNull('deleted_at'); }) ->get(); +nlog($multiple_contacts); + if (count($multiple_contacts) == 0) { Auth::logout(); diff --git a/app/Jobs/Util/StartMigration.php b/app/Jobs/Util/StartMigration.php index ab2e7d6cdb1b..e62b58d7f53e 100644 --- a/app/Jobs/Util/StartMigration.php +++ b/app/Jobs/Util/StartMigration.php @@ -91,15 +91,15 @@ class StartMigration implements ShouldQueue $archive = $zip->open(public_path("storage/{$this->filepath}")); $filename = pathinfo($this->filepath, PATHINFO_FILENAME); - if($this->company->id == $this->company->account->default_company_id) - { - $new_default_company = $this->company->account->companies->first(); + // if($this->company->id == $this->company->account->default_company_id) + // { + // $new_default_company = $this->company->account->companies->first(); - if ($new_default_company) { - $this->company->account->default_company_id = $new_default_company->id; - $this->company->account->save(); - } - } + // if ($new_default_company) { + // $this->company->account->default_company_id = $new_default_company->id; + // $this->company->account->save(); + // } + // } $update_product_flag = $this->company->update_products; @@ -128,8 +128,8 @@ class StartMigration implements ShouldQueue Storage::deleteDirectory(public_path("storage/migrations/{$filename}")); - $this->company->account->default_company_id = $this->company->id; - $this->company->account->save(); + // $this->company->account->default_company_id = $this->company->id; + // $this->company->account->save(); $this->company->update_products = $update_product_flag; $this->company->save(); diff --git a/resources/views/footer.blade.php b/resources/views/footer.blade.php index d2747eb7d610..2c415917f5c5 100644 --- a/resources/views/footer.blade.php +++ b/resources/views/footer.blade.php @@ -1,7 +1,7 @@