debug the excel reports
This commit is contained in:
@@ -229,7 +229,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'TarizRahCount' => 0,
|
||||
@@ -262,31 +262,31 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
foreach ($data as $value) {
|
||||
$array[$value->province_id] = [
|
||||
'province_fa' => $value->province_fa,
|
||||
'TarizRahCount' => $value->TarizRahCount ?? '-',
|
||||
'EslahGhosCount' => $value->EslahGhosCount ?? '-',
|
||||
'TaransheBardariCount' => $value->TaransheBardariCount ?? '-',
|
||||
'EhdasMeydanCount' => $value->EhdasMeydanCount ?? '-',
|
||||
'EhdasTaghatoCount' => $value->EhdasTaghatoCount ?? '-',
|
||||
'ImenSaziCount' => $value->ImenSaziCount ?? '-',
|
||||
'EslahVoroodiCount' => $value->EslahVoroodiCount ?? '-',
|
||||
'EhdasToonelCount' => $value->EhdasToonelCount ?? '-',
|
||||
'EhdasVariantCount' => $value->EhdasVariantCount ?? '-',
|
||||
'TarizAbnieFaniCount' => $value->TarizAbnieFaniCount ?? '-',
|
||||
'SakhtHaelCount' => $value->SakhtHaelCount ?? '-',
|
||||
'SayerCount' => $value->SakhtHaelCount ?? '-',
|
||||
'countAll' => $value->countAll ?? '-',
|
||||
'TarizRahAvg' => $value->TarizRahAvg ?? '-',
|
||||
'EslahGhosAvg' => $value->EslahGhosAvg ?? '-',
|
||||
'TaransheBardariAvg' => $value->TaransheBardariAvg ?? '-',
|
||||
'EhdasMeydanAvg' => $value->EhdasMeydanAvg ?? '-',
|
||||
'EhdasTaghatoAvg' => $value->EhdasTaghatoAvg ?? '-',
|
||||
'ImenSaziAvg' => $value->ImenSaziAvg ?? '-',
|
||||
'EslahVoroodiAvg' => $value->EslahVoroodiAvg ?? '-',
|
||||
'EhdasToonelAvg' => $value->EhdasToonelAvg ?? '-',
|
||||
'EhdasVariantAvg' => $value->EhdasVariantAvg ?? '-',
|
||||
'TarizAbnieFaniAvg' => $value->TarizAbnieFaniAvg ?? '-',
|
||||
'SakhtHaelAvg' => $value->SakhtHaelAvg ?? '-',
|
||||
'SayerAvg' => $value->SakhtHaelAvg ?? '-',
|
||||
'TarizRahCount' => $value->TarizRahCount ?? 0,
|
||||
'EslahGhosCount' => $value->EslahGhosCount ?? 0,
|
||||
'TaransheBardariCount' => $value->TaransheBardariCount ?? 0,
|
||||
'EhdasMeydanCount' => $value->EhdasMeydanCount ?? 0,
|
||||
'EhdasTaghatoCount' => $value->EhdasTaghatoCount ?? 0,
|
||||
'ImenSaziCount' => $value->ImenSaziCount ?? 0,
|
||||
'EslahVoroodiCount' => $value->EslahVoroodiCount ?? 0,
|
||||
'EhdasToonelCount' => $value->EhdasToonelCount ?? 0,
|
||||
'EhdasVariantCount' => $value->EhdasVariantCount ?? 0,
|
||||
'TarizAbnieFaniCount' => $value->TarizAbnieFaniCount ?? 0,
|
||||
'SakhtHaelCount' => $value->SakhtHaelCount ?? 0,
|
||||
'SayerCount' => $value->SakhtHaelCount ?? 0,
|
||||
'countAll' => $value->countAll ?? 0,
|
||||
'TarizRahAvg' => $value->TarizRahAvg ?? 0,
|
||||
'EslahGhosAvg' => $value->EslahGhosAvg ?? 0,
|
||||
'TaransheBardariAvg' => $value->TaransheBardariAvg ?? 0,
|
||||
'EhdasMeydanAvg' => $value->EhdasMeydanAvg ?? 0,
|
||||
'EhdasTaghatoAvg' => $value->EhdasTaghatoAvg ?? 0,
|
||||
'ImenSaziAvg' => $value->ImenSaziAvg ?? 0,
|
||||
'EslahVoroodiAvg' => $value->EslahVoroodiAvg ?? 0,
|
||||
'EhdasToonelAvg' => $value->EhdasToonelAvg ?? 0,
|
||||
'EhdasVariantAvg' => $value->EhdasVariantAvg ?? 0,
|
||||
'TarizAbnieFaniAvg' => $value->TarizAbnieFaniAvg ?? 0,
|
||||
'SakhtHaelAvg' => $value->SakhtHaelAvg ?? 0,
|
||||
'SayerAvg' => $value->SakhtHaelAvg ?? 0,
|
||||
];
|
||||
|
||||
$sum['TarizRahCount'] += $value->TarizRahCount;
|
||||
|
||||
@@ -167,7 +167,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'BotoniDoing' => 0,
|
||||
|
||||
@@ -69,11 +69,11 @@ class RoadUpgradeSafeties implements FromView, ShouldAutoSize, WithEvents, WithD
|
||||
'RoshanayiNoghteyi' => $road->operation_type_id1 == '304' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '304' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '304' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 : 0))),
|
||||
'AlaemImeni' => $road->operation_type_id1 == '305' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '305' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '305' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 : 0))),
|
||||
'Khatkeshi' => $road->operation_type_id1 == '306' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '306' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '306' ? $road->operation_type_amount3 :
|
||||
@@ -101,11 +101,11 @@ class RoadUpgradeSafeties implements FromView, ShouldAutoSize, WithEvents, WithD
|
||||
'RoshanayiNoghteyi' => $road->operation_type_id1 == '304' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '304' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '304' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
'AlaemImeni' => $road->operation_type_id1 == '305' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '305' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '305' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
'Khatkeshi' => $road->operation_type_id1 == '306' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '306' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '306' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
|
||||
@@ -290,7 +290,7 @@ class summaryAccidentPerformanceCity implements FromView, ShouldAutoSize, WithEv
|
||||
$query .= " GROUP BY city_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$array[$value->city_id] = [
|
||||
|
||||
@@ -271,7 +271,7 @@ class summaryAccidentPerformanceProject implements FromView, ShouldAutoSize, Wit
|
||||
$query .= " GROUP BY unique_code
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
return view('excel.Upgrade.summaryAccidentPerformanceProject', [
|
||||
'array' => $data,
|
||||
|
||||
@@ -281,7 +281,7 @@ class summaryAccidentPerformanceProvince implements FromView, ShouldAutoSize, Wi
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$provinces = \App\Models\Province::select('id', 'name_fa')
|
||||
->when($province, function($query, $province) {
|
||||
|
||||
@@ -57,10 +57,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 601 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 601 THEN operation_type_amount4
|
||||
END)) AS KhakiDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 601 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 601 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 601 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 601 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 601 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 601 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 601 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 601 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS KhakiDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN operation_type_amount1
|
||||
@@ -68,10 +68,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 602 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 602 THEN operation_type_amount4
|
||||
END)) AS RosaziDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 602 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 602 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 602 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 602 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 602 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 602 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS RosaziDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN operation_type_amount1
|
||||
@@ -79,10 +79,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 603 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 603 THEN operation_type_amount4
|
||||
END)) AS AbneyehDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 603 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 603 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 603 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 603 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 603 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 603 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS AbneyehDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN operation_type_amount1
|
||||
@@ -90,10 +90,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 604 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 604 THEN operation_type_amount4
|
||||
END)) AS AsphaltDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 604 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 604 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 604 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 604 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 604 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 604 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS AsphaltDone,
|
||||
COUNT(*) AS countAll,
|
||||
province_fa,
|
||||
@@ -113,7 +113,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'KhakiDoing' => 0,
|
||||
|
||||
@@ -62,7 +62,7 @@ class Village implements FromView, ShouldAutoSize, WithEvents, WithDrawings, Wit
|
||||
'Abnie' => $road->operation_type_id1 == '603' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '603' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '603' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 : 0))),
|
||||
|
||||
'Asphalt' => $road->operation_type_id1 == '604' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '604' ? $road->operation_type_amount2 :
|
||||
@@ -82,7 +82,7 @@ class Village implements FromView, ShouldAutoSize, WithEvents, WithDrawings, Wit
|
||||
'Abnie' => $road->operation_type_id1 == '603' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '603' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '603' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
|
||||
'Asphalt' => $road->operation_type_id1 == '604' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '604' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
|
||||
@@ -224,7 +224,7 @@ class summaryAcidentPerformanceCity implements FromView, ShouldAutoSize, WithEve
|
||||
$query .= " GROUP BY city_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$array[$value->city_id] = [
|
||||
|
||||
@@ -209,7 +209,7 @@ class summaryAcidentPerformanceProject implements FromView, ShouldAutoSize, With
|
||||
$query .= " GROUP BY unique_code
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
return view('excel.Village.summaryAccidentPerformanceProject', [
|
||||
'array' => $data,
|
||||
|
||||
@@ -211,7 +211,7 @@ class summaryAcidentPerformanceProvince implements FromView, ShouldAutoSize, Wit
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'KhakiDone' => 0,
|
||||
|
||||
Reference in New Issue
Block a user