mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 15:13:29 +01:00
Merge pull request #6102 from turbo124/v5-develop
Cross fill subdomains
This commit is contained in:
commit
a952011bf4
@ -59,6 +59,37 @@ class SubdomainFill extends Command
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$db1 = Company::on('db-ninja-01')->get();
|
||||||
|
|
||||||
|
$db1->each(function ($company){
|
||||||
|
|
||||||
|
$db2 = Company::on('db-ninja-02a')->find($company->id);
|
||||||
|
|
||||||
|
if($db2)
|
||||||
|
{
|
||||||
|
$db2->subdomain = $company->subdomain;
|
||||||
|
$db2->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$db1 = null;
|
||||||
|
$db2 = null;
|
||||||
|
|
||||||
|
$db2 = Company::on('db-ninja-02')->get();
|
||||||
|
|
||||||
|
$db2->each(function ($company){
|
||||||
|
|
||||||
|
$db1 = Company::on('db-ninja-01a')->find($company->id);
|
||||||
|
|
||||||
|
if($db1)
|
||||||
|
{
|
||||||
|
$db1->subdomain = $company->subdomain;
|
||||||
|
$db1->save();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user