fix code
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Exports\V3\Mission\Violation;
|
namespace App\Exports\V3\Mission\Report;
|
||||||
|
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Maatwebsite\Excel\Concerns\FromView;
|
use Maatwebsite\Excel\Concerns\FromView;
|
||||||
@@ -50,7 +50,7 @@ class CountryReport implements FromView, WithEvents, ShouldAutoSize, WithDrawing
|
|||||||
$exportRows[] = $row;
|
$exportRows[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('v3.Reports.Mission.Violation.CountryActivityReport', [
|
return view('v3.Reports.Mission.Report.CountryActivityReport', [
|
||||||
'rows' => $exportRows,
|
'rows' => $exportRows,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ class CountryReport implements FromView, WithEvents, ShouldAutoSize, WithDrawing
|
|||||||
$drawing2->setHeight(50);
|
$drawing2->setHeight(50);
|
||||||
$drawing2->setOffsetX(5);
|
$drawing2->setOffsetX(5);
|
||||||
$drawing2->setOffsetY(5);
|
$drawing2->setOffsetY(5);
|
||||||
$drawing2->setCoordinates('E1');
|
$drawing2->setCoordinates('C1');
|
||||||
return [$drawing, $drawing2];
|
return [$drawing, $drawing2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Exports\V3\Mission\Violation;
|
namespace App\Exports\V3\Mission\Report;
|
||||||
|
|
||||||
use App\Models\EdarateShahri;
|
use App\Models\EdarateShahri;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
@@ -25,10 +25,10 @@ class ProvinceReport implements FromView, WithEvents, ShouldAutoSize, WithDrawin
|
|||||||
$province = null;
|
$province = null;
|
||||||
|
|
||||||
foreach ($this->data as $r) {
|
foreach ($this->data as $r) {
|
||||||
$pid = (int) $r->province_id;
|
$cid = (int) $r->city_id;
|
||||||
$name = $r->city_name;
|
$name = $r->city_name;
|
||||||
|
|
||||||
if ($pid === -1) {
|
if ($cid === -1) {
|
||||||
$province = [
|
$province = [
|
||||||
'city_name' => $name,
|
'city_name' => $name,
|
||||||
'no_mission_count' => (int) ($r->no_mission_count ?? 0),
|
'no_mission_count' => (int) ($r->no_mission_count ?? 0),
|
||||||
@@ -38,14 +38,14 @@ class ProvinceReport implements FromView, WithEvents, ShouldAutoSize, WithDrawin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!isset($grid[$pid])) {
|
if (!isset($grid[$cid])) {
|
||||||
$grid[$pid] = [
|
$grid[$cid] = [
|
||||||
'city_name' => $name,
|
'city_name' => $name,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$grid[$pid]['no_mission_count'] = (int) ($r->no_mission_count ?? 0);
|
$grid[$cid]['no_mission_count'] = (int) ($r->no_mission_count ?? 0);
|
||||||
$grid[$pid]['out_of_area_count'] = (int) ($r->out_of_area_count ?? 0);
|
$grid[$cid]['out_of_area_count'] = (int) ($r->out_of_area_count ?? 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class ProvinceReport implements FromView, WithEvents, ShouldAutoSize, WithDrawin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return view('v3.Reports.Mission.Violation.ProvinceActivityReport', [
|
return view('v3.Reports.Mission.Report.ProvinceActivityReport', [
|
||||||
'rows' => $exportRows,
|
'rows' => $exportRows,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class ProvinceReport implements FromView, WithEvents, ShouldAutoSize, WithDrawin
|
|||||||
$drawing2->setHeight(50);
|
$drawing2->setHeight(50);
|
||||||
$drawing2->setOffsetX(5);
|
$drawing2->setOffsetX(5);
|
||||||
$drawing2->setOffsetY(5);
|
$drawing2->setOffsetY(5);
|
||||||
$drawing2->setCoordinates('E1');
|
$drawing2->setCoordinates('C1');
|
||||||
return [$drawing, $drawing2];
|
return [$drawing, $drawing2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||||
|
|
||||||
use App\Exports\V3\Mission\Violation\CountryReport;
|
use App\Exports\V3\Mission\Report\CountryReport;
|
||||||
use App\Exports\V3\Mission\Violation\ProvinceReport;
|
use App\Exports\V3\Mission\Report\ProvinceReport;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\City;
|
use App\Models\City;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th rowspan="1"
|
<th rowspan="1"
|
||||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
کد یکتا
|
استان
|
||||||
</th>
|
</th>
|
||||||
<th rowspan="1"
|
<th rowspan="1"
|
||||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($data as $item)
|
@foreach ($rows as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['id'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['no_mission_count'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['no_mission_count'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['out_of_area_count'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['out_of_area_count'] ?? '-' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th rowspan="1"
|
<th rowspan="1"
|
||||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
کد یکتا
|
شهر
|
||||||
</th>
|
</th>
|
||||||
<th rowspan="1"
|
<th rowspan="1"
|
||||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
@@ -62,9 +62,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($data as $item)
|
@foreach ($rows as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['id'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['no_mission_count'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['no_mission_count'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['out_of_area_count'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['out_of_area_count'] ?? '-' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
Reference in New Issue
Block a user