fix the blade

This commit is contained in:
2025-01-25 14:01:19 +03:30
parent ac2cb74398
commit 735e7f68e5
3 changed files with 14 additions and 20 deletions

View File

@@ -3,13 +3,12 @@
namespace App\Services\Reports;
use App\Models\InfoItem;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
class RoadItemReportService
{
public function countryActivityPerSubItem(int $item, string $fromDate, string $toDate): Collection
public function countryActivityPerSubItem(int $item, string $fromDate, string $toDate): array
{
$subItems = InfoItem::query()->where('item', $item)->get(['sub_item', 'sub_item_str', 'sub_item_unit']);
@@ -36,18 +35,18 @@ class RoadItemReportService
];
foreach ($subItems as $subItem) {
$totalItemCount = [
$totalItemCount[] = [
"total_count_{$subItem->sub_item}" => $activities->sum("Count_{$subItem->sub_item}"),
"total_sum_{$subItem->sub_item}" => $activities->sum("Sum_{$subItem->sub_item}"),
];
}
return collect([
return [
'data' => $activities->push($totalItemCount),
'fromDate' => $fromDate,
'toDate' => $toDate,
'details' => $subItems,
]);
];
}
public function provinceActivityPerSubItem(int $item, string $fromDate, string $toDate, int $provinceId): Collection