From b3fd7f70c81df5e75b4508db230457dcd70c996d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 26 May 2021 20:10:24 +1000 Subject: [PATCH] Fixes for import --- app/Jobs/Util/Import.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index d3fccae8cb..ef7d7bdfbf 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1654,6 +1654,8 @@ class Import implements ShouldQueue { $current_db = config('database.default'); + nlog($this->company); + $local_company = Company::on($current_db)->where('company_key', $this->company->company_key)->first(); MultiDB::setDb('db-ninja-01'); @@ -1692,7 +1694,7 @@ class Import implements ShouldQueue private function processNinjaTokens(array $data) { $current_db = config('database.default'); - $local_company = Company::find($this->company->id); + $local_company = Company::on($current_db)->where('company_key', $this->company->company_key)->first(); MultiDB::setDb('db-ninja-01');