Fix sync Bug
This commit is contained in:
parent
b64e841bde
commit
ed4bd4861a
@ -100,25 +100,27 @@ $ui->assign('_bills', $_bill);
|
||||
// Sync plan to router
|
||||
if (isset($_GET['sync']) && !empty($_GET['sync'])) {
|
||||
foreach ($_bill as $tur) {
|
||||
$p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']);
|
||||
if ($p) {
|
||||
$c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']);
|
||||
if ($c) {
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
if($tur['status'] == 'on'){
|
||||
$p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']);
|
||||
if ($p) {
|
||||
$c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']);
|
||||
if ($c) {
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
$log .= "DONE : $ptur[namebp], $tur[type], $tur[routers]<br>";
|
||||
} else {
|
||||
$log .= "Customer NOT FOUND : $tur[namebp], $tur[type], $tur[routers]<br>";
|
||||
}
|
||||
$log .= "DONE : $ptur[namebp], $tur[type], $tur[routers]<br>";
|
||||
} else {
|
||||
$log .= "Customer NOT FOUND : $tur[namebp], $tur[type], $tur[routers]<br>";
|
||||
$log .= "PLAN NOT FOUND : $tur[namebp], $tur[type], $tur[routers]<br>";
|
||||
}
|
||||
} else {
|
||||
$log .= "PLAN NOT FOUND : $tur[namebp], $tur[type], $tur[routers]<br>";
|
||||
}
|
||||
}
|
||||
r2(U . 'home', 's', $log);
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.8.1.1"
|
||||
"version": "2024.8.1.2"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user