Commit 171f1655 by Novan Bagus Setiawan

update searching ketua

parent 18e86753
...@@ -47,7 +47,7 @@ class KelompokController extends Controller ...@@ -47,7 +47,7 @@ class KelompokController extends Controller
$searchValue = strtoupper($search_arr['value']); // Search value $searchValue = strtoupper($search_arr['value']); // Search value
// Total records // Total records
$statementGlobal = " STATUS_HAPUS = '0' "; $statementGlobal = " KELOMPOK.STATUS_HAPUS = '0' ";
if($status != "0") if($status != "0")
{ {
...@@ -62,20 +62,23 @@ class KelompokController extends Controller ...@@ -62,20 +62,23 @@ class KelompokController extends Controller
} }
$totalRecords = Kelompok::select('count(1) as allcount')->whereRaw($statementGlobal)->count(); $totalRecords = Kelompok::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND (UPPER(NAMA_DOSEN) LIKE '%".$searchValue."%') "; $statement = " AND B.STATUS_KETUA = '1' AND (UPPER(NAMA_DOSEN) LIKE '%".$searchValue."%' OR (UPPER(NAMA) LIKE '%".$searchValue."%')) ";
$totalRecordswithFilter = Kelompok::select('count(1) as allcount') $totalRecordswithFilter = Kelompok::select('count(1) as allcount')
->join('kelompok_detil as b', 'kelompok.kelompok_id', '=', 'b.kelompok_id')
->whereRaw($statementGlobal.$statement)->count(); ->whereRaw($statementGlobal.$statement)->count();
// Fetch records // Fetch records
$records = Kelompok::orderBy($columnName,$columnSortOrder) $records = Kelompok::orderBy($columnName,$columnSortOrder)
->join('kelompok_detil as b', 'kelompok.kelompok_id', '=', 'b.kelompok_id')
->whereRaw($statementGlobal.$statement) ->whereRaw($statementGlobal.$statement)
->selectRaw('*, ambil_ketua_kelompok(kelompok.kelompok_id) ketua') ->selectRaw('kelompok.kelompok_id, kode, nama_dosen, nidn_dosen, status, ambil_ketua_kelompok(kelompok.kelompok_id) ketua')
->skip($start) ->skip($start)
->take($rowperpage) ->take($rowperpage)
->get(); ->get();
$data_arr = array(); $data_arr = array();
foreach($records as $record){ foreach($records as $record){
$kelompok_id = $record->kelompok_id; $kelompok_id = $record->kelompok_id;
$kode = $record->kode; $kode = $record->kode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment