Commit 6331cb46 by Triyah Fatmawati

Fix jika data reviewer di isdm kurang tidak simpan data

parent ca5d87a2
...@@ -157,23 +157,32 @@ public function store(Request $request){ ...@@ -157,23 +157,32 @@ public function store(Request $request){
$count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$reviewer)->select('noktp')->get(); $count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$reviewer)->select('noktp')->get();
if(count($count) >= 2){ if($reviewer->count == $count->count()){
foreach($count as $sdm){ if(count($count) >= 2){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip','namaparentsatker')->first(); foreach($count as $sdm){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip','namaparentsatker')->first();
$saku = [ $saku = [
'id_pengajuan' => $hasil->id, 'id_pengajuan' => $hasil->id,
'nik' => $sdm->noktp, 'nik' => $sdm->noktp,
'nama' => $isdm->namalengkap, 'nama' => $isdm->namalengkap,
'nip' => $isdm->nip, 'nip' => $isdm->nip,
'unit' => $isdm->namaparentsatker 'unit' => $isdm->namaparentsatker
]; ];
Penelaah::query()->create($saku); Penelaah::query()->create($saku);
} }
} else { } else {
foreach($count as $sdm){
$data['kosong'] = VPenelaah::where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
}
return view('transaksi-gagal', $data);
}
}
else{
foreach($count as $sdm){ foreach($count as $sdm){
$data['kosong'] = VPenelaah::where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first(); $data['kosong'] = VPenelaah::where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
} }
......
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