debug the accident module

This commit is contained in:
2025-08-30 14:07:37 +03:30
parent ab24f8502c
commit bb8262b896
7 changed files with 199 additions and 12 deletions

View File

@@ -26,7 +26,8 @@ class CountryReport implements FromView, ShouldAutoSize, WithEvents, WithDrawing
$country = array_search(-1, array_column($data['data'], 'province_id'));
$activities[] = [
'name' => 'کل کشور',
'province_id' => -1,
'province_fa' => 'کل کشور',
'tedade' => $data['data'][$country]->tedade,
'police_rah' => $data['data'][$country]->police_rah,
'gozaresh_gasht' => $data['data'][$country]->gozaresh_gasht,
@@ -35,6 +36,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithEvents, WithDrawing
'vasel_shode_bimeh' => $data['data'][$country]->vasel_shode_bimeh ?? 0,
'vasel_shode_daghi' => $data['data'][$country]->vasel_shode_daghi ?? 0,
'vasel_shode_final' => $data['data'][$country]->vasel_shode_final ?? 0,
'egdam' => $data['data'][$country]->egdam ?? 0,
'khatm' => $data['data'][$country]->khatm ?? 0,
'pardakht' => $data['data'][$country]->pardakht ?? 0,
];
foreach (Province::all() as $province) {
@@ -43,7 +47,8 @@ class CountryReport implements FromView, ShouldAutoSize, WithEvents, WithDrawing
if ($existingProvince) {
$activities[] = [
'name' => $province->name_fa,
'province_id' => $province->id,
'province_fa' => $province->name_fa,
'tedade' => $data['data'][$existingProvince]->tedade,
'police_rah' => $data['data'][$existingProvince]->police_rah,
'gozaresh_gasht' => $data['data'][$existingProvince]->gozaresh_gasht,
@@ -52,10 +57,14 @@ class CountryReport implements FromView, ShouldAutoSize, WithEvents, WithDrawing
'vasel_shode_bimeh' => $data['data'][$existingProvince]->vasel_shode_bimeh ?? 0,
'vasel_shode_daghi' => $data['data'][$existingProvince]->vasel_shode_daghi ?? 0,
'vasel_shode_final' => $data['data'][$existingProvince]->vasel_shode_final ?? 0,
'egdam' => $data['data'][$country]->egdam ?? 0,
'khatm' => $data['data'][$country]->khatm ?? 0,
'pardakht' => $data['data'][$country]->pardakht ?? 0,
];
} else {
$activities[] = [
'name' => $province->name_fa,
'province_id' => $province->id,
'province_fa' => $province->name_fa,
'tedade' => "",
'police_rah' => "",
'gozaresh_gasht' => "",
@@ -64,6 +73,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithEvents, WithDrawing
'vasel_shode_bimeh' => "",
'vasel_shode_daghi' => "",
'vasel_shode_final' => "",
'egdam' => "",
'khatm' => "",
'pardakht' => "",
];
}
}

View File

@@ -26,7 +26,8 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithEvents, WithDrawin
$province = array_search(-1, array_column($reportData, 'province_id'));
$activities[] = [
'name' => 'کل استان',
'city_id' => -1,
'city_fa' => 'کل استان',
'tedade' => $reportData['data'][$province]->tedade,
'police_rah' => $reportData['data'][$province]->police_rah,
'gozaresh_gasht' => $reportData['data'][$province]->gozaresh_gasht,
@@ -35,6 +36,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithEvents, WithDrawin
'vasel_shode_bimeh' => $reportData['data'][$province]->vasel_shode_bimeh ?? 0,
'vasel_shode_daghi' => $reportData['data'][$province]->vasel_shode_daghi ?? 0,
'vasel_shode_final' => $reportData['data'][$province]->vasel_shode_final ?? 0,
'egdam' => $reportData['data'][$province]->egdam ?? 0,
'khatm' => $reportData['data'][$province]->khatm ?? 0,
'pardakht' => $reportData['data'][$province]->pardakht ?? 0,
];
foreach ($inputData['cities'] as $city) {
@@ -43,7 +47,8 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithEvents, WithDrawin
if ($existingCity) {
$activities[] = [
'name' => $city->name_fa,
'city_id' => -1,
'city_fa' => 'کل استان',
'tedade' => $reportData['data'][$existingCity]->tedade,
'police_rah' => $reportData['data'][$existingCity]->police_rah,
'gozaresh_gasht' => $reportData['data'][$existingCity]->gozaresh_gasht,
@@ -52,6 +57,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithEvents, WithDrawin
'vasel_shode_bimeh' => $reportData['data'][$existingCity]->vasel_shode_bimeh ?? 0,
'vasel_shode_daghi' => $reportData['data'][$existingCity]->vasel_shode_daghi ?? 0,
'vasel_shode_final' => $reportData['data'][$existingCity]->vasel_shode_final ?? 0,
'egdam' => $reportData['data'][$province]->egdam ?? 0,
'khatm' => $reportData['data'][$province]->khatm ?? 0,
'pardakht' => $reportData['data'][$province]->pardakht ?? 0,
];
} else {
$activities[] = [
@@ -64,6 +72,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithEvents, WithDrawin
'vasel_shode_bimeh' => "",
'vasel_shode_daghi' => "",
'vasel_shode_final' => "",
'egdam' => "",
'khatm' => "",
'pardakht' => "",
];
}
}