fix render data and show count rab krk and dlh

This commit is contained in:
arifal hidayat
2025-08-19 04:02:08 +07:00
parent 7c7aa0e2a5
commit d7e9f44b20
6 changed files with 74 additions and 24 deletions

View File

@@ -26,12 +26,12 @@ class BigDataResumeController extends Controller
$type = $request->get("type");
if (!$filterDate || $filterDate === "latest") {
$big_data_resume = BigdataResume::where('year', $type)->latest()->first();
$big_data_resume = BigdataResume::where('resume_type', $type)->latest()->first();
if (!$big_data_resume) {
return $this->response_empty_resume();
}
} else {
$big_data_resume = BigdataResume::where('year', $type)
$big_data_resume = BigdataResume::where('resume_type', $type)
->whereDate('created_at', $filterDate)
->orderBy('id', 'desc')
->first();
@@ -46,10 +46,6 @@ class BigDataResumeController extends Controller
return response()->json(['message' => 'No data setting found']);
}
function cleanNumber($value) {
return floatval(str_replace('.', '', $value));
}
$target_pad = floatval(optional($data_settings->where('key', 'TARGET_PAD')->first())->value);
$realisasi_terbit_pbg_sum = $big_data_resume->issuance_realization_pbg_sum;
$realisasi_terbit_pbg_count = $big_data_resume->issuance_realization_pbg_count;
@@ -107,6 +103,12 @@ class BigDataResumeController extends Controller
$proses_dinas_teknis_percentage = $big_data_resume->verified_sum > 0 && $proses_dinas_teknis_sum >= 0
? round(($proses_dinas_teknis_sum / $big_data_resume->verified_sum) * 100, 2) : 0;
$business_rab_count = $big_data_resume->business_rab_count;
$business_krk_count = $big_data_resume->business_krk_count;
$non_business_rab_count = $big_data_resume->non_business_rab_count;
$non_business_krk_count = $big_data_resume->non_business_krk_count;
$non_business_dlh_count = $big_data_resume->non_business_dlh_count;
$result = [
'target_pad' => [
'sum' => $target_pad,
@@ -160,7 +162,12 @@ class BigDataResumeController extends Controller
'sum' => $proses_dinas_teknis_sum,
'count' => $proses_dinas_teknis_count,
'percentage' => $proses_dinas_teknis_percentage
]
],
'business_rab_count' => $business_rab_count,
'business_krk_count' => $business_krk_count,
'non_business_rab_count' => $non_business_rab_count,
'non_business_krk_count' => $non_business_krk_count,
'non_business_dlh_count' => $non_business_dlh_count
];
return response()->json($result);
}catch(\Exception $e){