fix tbl_bandwidth error, make Hotspot and PPPOE list failed to load

This commit is contained in:
Ibnu Maksum 2024-06-21 21:18:20 +07:00
parent efe7b8b8f8
commit 00d3295632
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 16 additions and 5 deletions

View File

@ -82,7 +82,12 @@ switch ($action) {
. "&router=" . urlencode($router); . "&router=" . urlencode($router);
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray(); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray();
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->where_in('id', array_column($bws, 'id_bw'))->findArray()); $ids = array_column($bws, 'id_bw');
if(count($ids)){
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
$ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp"));
$ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit"));
@ -446,8 +451,13 @@ switch ($action) {
. "&status=" . urlencode($status) . "&status=" . urlencode($status)
. "&router=" . urlencode($router); . "&router=" . urlencode($router);
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->findArray(); $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'PPPOE')->findArray();
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->where_in('id', array_column($bws, 'id_bw'))->findArray()); $ids = array_column($bws, 'id_bw');
if(count($ids)){
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type")); $ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
$ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp"));
$ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit"));

View File

@ -511,5 +511,6 @@
"Period": "Periode", "Period": "Periode",
"Rate": "Kecepatan", "Rate": "Kecepatan",
"Burst": "Meletus", "Burst": "Meletus",
"Router_Name___Location": "Nama\/Lokasi Router" "Router_Name___Location": "Nama\/Lokasi Router",
"Extend": "Memperpanjang"
} }

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.6.21.2" "version": "2024.6.21.3"
} }