Commit ecaad90b by Siti Aisah

fix create penelaah

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