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.
63 lines
1.8 KiB
63 lines
1.8 KiB
11 months ago
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use CodeIgniter\Model;
|
||
|
|
||
|
class Mdetkat extends Model
|
||
|
{
|
||
|
|
||
|
|
||
|
protected $table = 'DASHBOARD_BESAR_MAPKJS';
|
||
|
|
||
|
function cdetKat($param)
|
||
|
{
|
||
|
$tahun = $param['tahun'];
|
||
|
$bln = $param['bln'];
|
||
|
$kwl = $param['kwl'];
|
||
|
$kpp = $param['kpp'];
|
||
|
$seksi = $param['seksi'];
|
||
|
$nip = $param['nip'];
|
||
|
$kategori = $param['kategori'];
|
||
|
$query = $this->db->query("SELECT NPWP,NAMA,KATEGORI,TOTAL
|
||
|
FROM DASHBOARD_BESAR_MAPKJS
|
||
|
WHERE THNBYR = '" . $tahun . "'
|
||
|
AND KWLADM = '" . $kwl . "'
|
||
|
AND BLNBYR <= '" . $bln . "'
|
||
|
AND KPPADM='" . $kpp . "'
|
||
|
AND KODESIE='" . $seksi . "'
|
||
|
AND NIP='" . $nip . "'
|
||
|
AND KATEGORI='" . $kategori . "' ");
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
function detKat($param)
|
||
|
{
|
||
|
|
||
|
$tahun = $param['tahun'];
|
||
|
$bln = $param['bln'];
|
||
|
$kwl = $param['kwl'];
|
||
|
$kpp = $param['kpp'];
|
||
|
$seksi = $param['seksi'];
|
||
|
$nip = $param['nip'];
|
||
|
$offset = $param['page'];
|
||
|
$limit = $param['perPage'];
|
||
|
$kategori = $param['kategori'];
|
||
|
|
||
|
$this->builder()
|
||
|
->select('NPWP,NAMA')
|
||
|
->selectSum('TOTAL')
|
||
|
->where('THNBYR', $tahun)
|
||
|
->where('KWLADM', $kwl)
|
||
|
->where('KPPADM', $kpp)
|
||
|
->where('KODESIE', $seksi)
|
||
|
->where('NIP', $nip)
|
||
|
->where('KATEGORI', $kategori)
|
||
|
->where('BLNBYR <=', $bln)
|
||
|
->groupBy('NPWP,NAMA')
|
||
|
->limit($limit, $offset);
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
}
|