fix the blade
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user