You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.4 KiB
54 lines
1.4 KiB
<?php |
|
namespace App\Controllers\Kewilayahan\Sebaran; |
|
|
|
class Pengampu extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
{ |
|
protected function data($request, $jenis) |
|
{ |
|
ini_set('max_input_vars', 3000); |
|
$opsiWilZona = $request->getPost('opsiWilZona'); |
|
$adm4_pcode = $request->getPost('adm4_pcode') ?? []; |
|
$id_poly_zona = $request->getPost('id_poly_zona') ?? []; |
|
|
|
$db = \Config\Database::connect(); |
|
|
|
$npwp = $db->table('KPDL_MV_LOKASI_SUBJEK')->select("NM_KANTOR_PENGAMPU, count(1) JML", false) |
|
->groupBy("NM_KANTOR_PENGAMPU")->orderBy("JML", 'desc'); |
|
|
|
switch ($jenis) { |
|
case 'assign': |
|
|
|
break; |
|
case 'unassign': |
|
$npwp = $npwp->where("NM_KANTOR_PENGAMPU", "NPWP TIDAK DITEMUKAN"); |
|
break; |
|
default: |
|
|
|
break; |
|
} |
|
|
|
if ($opsiWilZona == 'wilayah') { |
|
$npwp->whereIn('ADM4_PCODE', $adm4_pcode); |
|
} |
|
|
|
if ($opsiWilZona == 'zona') { |
|
$npwp->whereIn('ID_POLY_ZONA', $id_poly_zona); |
|
} |
|
|
|
$data = $npwp->get()->getResult(); |
|
|
|
$ret = []; |
|
|
|
foreach ($data as $b) { |
|
|
|
array_push($ret, ['name' => $b->NM_KANTOR_PENGAMPU, |
|
// 'color' => , |
|
'y' => floatval($b->JML), |
|
] |
|
); |
|
} |
|
|
|
return $ret; |
|
} |
|
}
|
|
|