mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 00:11:35 +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');
|
$current = config('database.default');
|
||||||
config(['database.default' => DB_NINJA_LOOKUP]);
|
config(['database.default' => DB_NINJA_LOOKUP]);
|
||||||
|
|
||||||
$server = DbServer::whereName($current)->firstOrFail();
|
$server = DbServer::whereName($current)->firstOrFail();
|
||||||
$lookupCompany = LookupCompany::whereDbServerId($server->id)
|
$lookupCompany = LookupCompany::whereDbServerId($server->id)
|
||||||
->whereCompanyId($companyId)->first();
|
->whereCompanyId($companyId)->first();
|
||||||
@ -49,4 +49,10 @@ class LookupAccount extends LookupModel
|
|||||||
|
|
||||||
static::setDbServer($current);
|
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');
|
return $this->belongsTo('App\Models\DbServer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDbServer()
|
||||||
|
{
|
||||||
|
return $this->dbServer->name;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user