Commit ecaad90b by Siti Aisah

fix create penelaah

parent d01b8225
......@@ -101,22 +101,25 @@ public function store(Request $request){
$rev[$r->nik] = $r->nik;
}
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$rev)->select('namalengkap','nip','noktp')->get();
$count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$rev)->select('namalengkap','nip','noktp')->get();
if(count($count) >= 2){
foreach($count as $sdm){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip')->first();
if(count($isdm) >= 2){
foreach($isdm as $sdm){
$saku = [
'id_pengajuan' => $hasil->id,
'nik' => $sdm->noktp,
'nama' => $sdm->namalengkap,
'nip' => $sdm->nip
'nama' => $isdm->namalengkap,
'nip' => $isdm->nip
];
}
Penelaah::query()->create($saku);
}
} else {
foreach($isdm as $sdm){
foreach($count as $sdm){
$data['kosong'] = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
}
......@@ -129,6 +132,7 @@ public function store(Request $request){
->with('success', 'Data kategori berhasil diupdate');
}
catch(Exception $e){
dd($e);
Log::error($e);
DB::rollBack();
......
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