-2
改變如何CI如何在CI
$sql1= "SELECT kwsn,SUM(jumlah) as jumlah, count(DISTINCT y.noid) as noid from
(select DISTINCT (a.noid_new) AS noid, a.kwsn FROM tagihandonatur a where Bulan=".$bulan." and kodej='".$_POST['id_usr']."') z
left join (SELECT noid,SUM(jumlah) as jumlah FROM report_tagih WHERE ((tanggal>= '".$tgl."' and tanggal<= '".$tgl2."') OR tanggal like '".$tgl."%') and kodej='".$_POST['id_usr']."'
group by noid) y on y.noid= z.noid
group by z.kwsn order by z.kwsn";
$rs= $dtaccess->Execute($sql1);
$dataTotal=$dtaccess->FetchAll($rs);