Update
This commit is contained in:
@@ -32,14 +32,19 @@ class ItemSearchController extends Controller
|
||||
{
|
||||
$tropd = [];
|
||||
if($request->has('q')){
|
||||
$ta = $request->ta;
|
||||
$search = strtoupper($request->q);
|
||||
if($request->has('realisasi-belanja')){
|
||||
$select = DB::raw("DISTINCT KODE_SKPD AS ID,KODE_SKPD||' | '||NAMA_SKPD as name");
|
||||
$ta = $request->ta;
|
||||
$tropd = BelanjaRealisasi::select($select)
|
||||
->where("TAHUN_ANGGARAN", $ta)
|
||||
->where('NAMA_SKPD', 'LIKE', "%$search%")
|
||||
->get();
|
||||
$sqlStr = "SELECT DISTINCT x.KODE_SKPD AS ID,x.KODE_SKPD||' | '||x.NAMA_SKPD as name
|
||||
FROM SAMASA.BELANJA_REALISASI x
|
||||
LEFT JOIN NEWSIPKD.TROPD y ON x.KODE_SKPD = y.C_OPD
|
||||
WHERE TAHUN_ANGGARAN = $ta AND
|
||||
NAMA_SKPD LIKE '%$search%' ";
|
||||
|
||||
if (getRole()=="sbpk"){
|
||||
$sqlStr.= " AND y.C_WIL_SP2DPROSES=".Auth::user()->wilayah;
|
||||
}
|
||||
$tropd = DB::select(DB::raw($sqlStr." ORDER BY x.KODE_SKPD "));
|
||||
}else{
|
||||
$select = DB::raw("C_OPD AS ID,C_OPD||' | '||N_OPD as name");
|
||||
$tropd = Tropd::select($select)
|
||||
|
||||
Reference in New Issue
Block a user