diff --git a/app/Models/LookupAccount.php b/app/Models/LookupAccount.php index 0d14677339..7d5cd8e8c1 100644 --- a/app/Models/LookupAccount.php +++ b/app/Models/LookupAccount.php @@ -30,7 +30,7 @@ class LookupAccount extends LookupModel $current = config('database.default'); config(['database.default' => DB_NINJA_LOOKUP]); - + $server = DbServer::whereName($current)->firstOrFail(); $lookupCompany = LookupCompany::whereDbServerId($server->id) ->whereCompanyId($companyId)->first(); @@ -49,4 +49,10 @@ class LookupAccount extends LookupModel static::setDbServer($current); } + + public function getDbServer() + { + return $this->lookupCompany->dbServer->name; + } + } diff --git a/app/Models/LookupCompany.php b/app/Models/LookupCompany.php index a5ba316fad..e2ded54884 100644 --- a/app/Models/LookupCompany.php +++ b/app/Models/LookupCompany.php @@ -22,4 +22,9 @@ class LookupCompany extends LookupModel return $this->belongsTo('App\Models\DbServer'); } + public function getDbServer() + { + return $this->dbServer->name; + } + }