mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Test for truth
This commit is contained in:
parent
fa602ef0cd
commit
9d8ee8a44e
@ -253,10 +253,13 @@ class MultiDB
|
|||||||
|
|
||||||
public static function findAndSetDbByDomain($subdomain) :bool
|
public static function findAndSetDbByDomain($subdomain) :bool
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (! config('ninja.db.multi_db_enabled'))
|
||||||
|
return (Company::on($db)->whereSubdomain($subdomain)->exists() === true);
|
||||||
|
|
||||||
foreach (self::$dbs as $db) {
|
foreach (self::$dbs as $db) {
|
||||||
if ($company = Company::on($db)->whereSubdomain($subdomain)->first()) {
|
if ($company = Company::on($db)->whereSubdomain($subdomain)->first()) {
|
||||||
self::setDb($company->db);
|
self::setDb($company->db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user