mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-19 16:01:34 +02:00
Multi-db fixes
This commit is contained in:
parent
6a02c6e80e
commit
2e76d9772a
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,4 +22,9 @@ class LookupCompany extends LookupModel
|
||||
return $this->belongsTo('App\Models\DbServer');
|
||||
}
|
||||
|
||||
public function getDbServer()
|
||||
{
|
||||
return $this->dbServer->name;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user