fix(surveyor/penilai): perbaikkan jadwal kunjungan dan print out memo
This commit is contained in:
@@ -968,8 +968,8 @@ class PenilaiController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
$existingPhotos = isset($memo->memo) ? json_decode($memo->memo)->foto : [];
|
||||
dd($existingPhotos);
|
||||
// $existingPhotos = isset($memo->memo) ? json_decode($memo->memo) : [];
|
||||
// dd($existingPhotos);
|
||||
// Simpan foto-foto
|
||||
if ($request->hasFile('foto_0')) {
|
||||
$photoUrls = [];
|
||||
@@ -982,15 +982,15 @@ class PenilaiController extends Controller
|
||||
$index++;
|
||||
}
|
||||
|
||||
$memoData['foto'] = array_merge($existingPhotos, $photoUrls);
|
||||
// $memoData['foto'] = array_merge($existingPhotos, $photoUrls);
|
||||
|
||||
}else{
|
||||
$memoData['foto'] = $existingPhotos;
|
||||
}
|
||||
// }else{
|
||||
// $memoData['foto'] = $existingPhotos;
|
||||
// Tambahkan URL foto ke data memo
|
||||
$memoData['foto'] = $photoUrls;
|
||||
$memo->memo = json_encode($memoData);
|
||||
$memo->save();
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
|
||||
Reference in New Issue
Block a user