From 00d3295632934c418676c05dbed73efe7a0ce3cc Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 21 Jun 2024 21:18:20 +0700 Subject: [PATCH] fix tbl_bandwidth error, make Hotspot and PPPOE list failed to load --- system/controllers/services.php | 16 +++++++++++++--- system/lan/indonesia.json | 3 ++- version.json | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/system/controllers/services.php b/system/controllers/services.php index 1daad2e1..aaa69635 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -82,7 +82,12 @@ switch ($action) { . "&router=" . urlencode($router); $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('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); @@ -446,8 +451,13 @@ switch ($action) { . "&status=" . urlencode($status) . "&router=" . urlencode($router); - $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->findArray(); - $ui->assign('bws', ORM::for_table('tbl_bandwidth')->selects(["id", 'name_bw'])->where_in('id', array_column($bws, 'id_bw'))->findArray()); + $bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'PPPOE')->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('type3s', ORM::for_table('tbl_plans')->getEnum("typebp")); $ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit")); diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index eb7da1c3..a06a21ca 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -511,5 +511,6 @@ "Period": "Periode", "Rate": "Kecepatan", "Burst": "Meletus", - "Router_Name___Location": "Nama\/Lokasi Router" + "Router_Name___Location": "Nama\/Lokasi Router", + "Extend": "Memperpanjang" } \ No newline at end of file diff --git a/version.json b/version.json index 14b43a94..54e5c01f 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.6.21.2" + "version": "2024.6.21.3" } \ No newline at end of file