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.
56 lines
1.5 KiB
56 lines
1.5 KiB
11 months ago
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use CodeIgniter\Model;
|
||
|
|
||
|
class Mdetpaycomp extends Model
|
||
|
{
|
||
|
|
||
|
|
||
|
protected $table = 'DASHBOARD_WP_BLN';
|
||
|
|
||
|
function cdetKat($param)
|
||
|
{
|
||
|
$tahun = $param['tahun'];
|
||
|
$kwl = $param['kwl'];
|
||
|
$kpp = $param['kpp'];
|
||
|
$seksi = $param['seksi'];
|
||
|
$nip = $param['nip'];
|
||
|
$jmlbln = $param['jmlbln'];
|
||
|
$query = $this->db->query("SELECT NPWP,NAMA,SUM(TOTAL) FROM(
|
||
|
SELECT NPWP, NAMA, TOTAL,COUNT(1) JMLBLN
|
||
|
FROM DASHBOARD_WP_BLN WHERE TAHUN = '" . $tahun . "' AND KWLADM = '" . $kwl . "' AND KPPADM = '" . $kpp . "' AND KODESIE = '" . $seksi . "' AND NIP = '" . $nip . "'
|
||
|
GROUP BY NPWP,NAMA,TOTAL) WHERE JMLBLN = '" . $jmlbln . "'
|
||
|
GROUP BY NPWP,NAMA ");
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
function detKat($param)
|
||
|
{
|
||
|
|
||
|
$tahun = $param['tahun'];
|
||
|
$kwl = $param['kwl'];
|
||
|
$kpp = $param['kpp'];
|
||
|
$seksi = $param['seksi'];
|
||
|
$nip = $param['nip'];
|
||
|
$jmlbln = $param['jmlbln'];
|
||
|
$offset = $param['page'];
|
||
|
$limit = $param['perPage'];
|
||
|
|
||
|
$this->builder()
|
||
|
->select('NPWP,NAMA')
|
||
|
->selectSum('TOTAL')
|
||
|
->selectCount('1', 'JMLBLN')
|
||
|
->where('TAHUN', $tahun)
|
||
|
->where('KWLADM', $kwl)
|
||
|
->where('KPPADM', $kpp)
|
||
|
->where('KODESIE', $seksi)
|
||
|
->where('NIP', $nip)
|
||
|
->groupBy('NPWP,NAMA')
|
||
|
->having('COUNT(1)', $jmlbln, TRUE)
|
||
|
->limit($limit, $offset);
|
||
|
return $this;
|
||
|
}
|
||
|
}
|