perbaikan data pembanding

This commit is contained in:
majid
2025-01-13 10:48:07 +07:00
parent 8db7e5d654
commit 0f4a0a12ee
4 changed files with 105 additions and 91 deletions

View File

@@ -1056,25 +1056,26 @@ class SurveyorController extends Controller
{
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];
if (isset($request->action) &&
in_array(strtoupper($request->action), array_map('strtoupper', $tanahBangunanTypes))) {
$action = isset($request->action) ? strtoupper(str_replace('-', ' ', $request->action)) : '';
if (in_array($action, $tanahBangunanTypes)) {
$fields = [
'address', 'village_code', 'district_code', 'city_code', 'province_code',
'nama', 'type','warna','lokasi', 'total', 'diskon', 'harga_diskon',
'sumber_data', 'harga', 'tahun','transmisi','telepon',
'kordinat_lat', 'kordinat_lng', 'tahun_pembuatan','merek_buatan','kapasitas','power','kondisi'
];
}else{
$fields = [
'address', 'village_code', 'district_code', 'city_code', 'province_code',
'tahun', 'luas_tanah', 'luas_bangunan', 'tahun_bangunan',
'status_nara_sumber', 'harga', 'harga_diskon', 'diskon', 'total', 'nama_nara_sumber',
'peruntukan', 'penawaran', 'telepon','hak_properti',
'kordinat_lat', 'kordinat_lng', 'jenis_aset','foto_objek'
];
}
} else {
$fields = [
'address', 'village_code', 'district_code', 'city_code', 'province_code',
'tahun', 'luas_tanah', 'luas_bangunan', 'tahun_bangunan',
'status_nara_sumber', 'harga', 'harga_diskon', 'diskon', 'total', 'nama_nara_sumber',
'peruntukan', 'penawaran', 'telepon','hak_properti',
'kordinat_lat', 'kordinat_lng', 'jenis_aset','foto_objek'
];
}
$pembanding = [];
foreach ($fields as $field) {
@@ -1313,8 +1314,7 @@ class SurveyorController extends Controller
}
$dataForm['alamat'][$alamatStatus][$field] = $newValue;
}
else {
} else {
if (!isset($dataForm[$field])) {
$dataForm[$field] = [];
}
@@ -1399,11 +1399,12 @@ class SurveyorController extends Controller
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];
if (isset($request->action) &&
in_array(strtoupper($request->action), array_map('strtoupper', $tanahBangunanTypes))) {
$action = isset($request->action) ? strtoupper(str_replace('-', ' ', $request->action)) : '';
if (in_array($action, $tanahBangunanTypes)) {
$objekPenilaian = $this->formatObjekPenilaiankendaraan($request);
}else{
} else {
$objekPenilaian = $this->formatObjekPenilaian($request);
}
if ($request->hasFile('foto_objek')) {
@@ -1708,8 +1709,9 @@ class SurveyorController extends Controller
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];
if (isset($inspectionData['action']) &&
in_array(strtoupper($inspectionData['action']), array_map('strtoupper', $tanahBangunanTypes))) {
$action = isset($inspectionData['action']) ? strtoupper(str_replace('-', ' ', $inspectionData['action'])) : '';
if (in_array($action, $tanahBangunanTypes)) {
return $selectedProvince = $inspectionData['alamat']['sesuai'][$code] ?? null;
}
@@ -1719,7 +1721,7 @@ class SurveyorController extends Controller
return $selectedProvince;
}
return null;
}