This commit is contained in:
amirghasempoor
2026-06-14 14:13:44 +03:30
parent 75c649c48e
commit ab9838c1bc
2 changed files with 20 additions and 13 deletions

View File

@@ -18,14 +18,16 @@ class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
} }
public function view(): View public function view(): View
{ $exportRows = []; {
$exportRows = [];
foreach ($this->data as $r) { foreach ($this->data as $r) {
$exportRows[] = [ $exportRows[] = [
'city_name' => $r->c_name ?? '', 'machine_id' => $r->c_name ?? '',
'province_name' => $r->p_name ?? '', 'machine_code' => $r->machine_code ?? '',
'car_name' => $r->car_name ?? '',
'missions' => $r->missions ?? 0, 'missions' => $r->missions ?? 0,
'distance' => (int) ($r->distance ?? 0), 'func' => (int) ($r->func ?? 0),
]; ];
} }

View File

@@ -46,19 +46,23 @@
<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;">
شهر مدل ماشین </th>
<th rowspan="1"
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
کد ماشین
</th>
<th rowspan="1"
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;">
تعداد ماموریت </th> تعداد ماموریت </th>
<th rowspan="1"
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
جمع کارکرد
</th>
</tr> </tr>
</thead> </thead>
@@ -66,10 +70,11 @@
<tbody> <tbody>
@foreach ($rows as $item) @foreach ($rows as $item)
<tr> <tr>
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td> <td style="border: 1px solid black;text-align: center;">{{ $item['machine_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['car_name'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['machine_code'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td> <td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['distance'] ?? '-' }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>