debug city export
This commit is contained in:
@@ -49,14 +49,14 @@ class RoadItemReportService
|
||||
];
|
||||
}
|
||||
|
||||
public function provinceActivityPerSubItem(int $item, string $fromDate, string $toDate, int $provinceId): Collection
|
||||
public function provinceActivityPerSubItem(int $item, string $fromDate, string $toDate, int $provinceId): array
|
||||
{
|
||||
$subItems = InfoItem::query()->where('item', $item)
|
||||
->orderBy('sub_item')
|
||||
->get(['sub_item', 'sub_item_str', 'sub_item_unit']);
|
||||
|
||||
$query = DB::table('road_items_projects')
|
||||
->selectRaw('province_id, province_fa, user_name as city_fa, city_id');
|
||||
->selectRaw('province_id, province_fa, TRIM(SUBSTRING_INDEX(user_name, "استان", 1)) as city_fa, city_id');
|
||||
|
||||
foreach ($subItems as $subItem) {
|
||||
$query->selectRaw("
|
||||
@@ -83,11 +83,11 @@ class RoadItemReportService
|
||||
$totalItemCount["Sum_{$subItem->sub_item}"] = $activities->sum("Sum_{$subItem->sub_item}");
|
||||
}
|
||||
|
||||
return collect([
|
||||
return [
|
||||
'data' => $activities->push((object)$totalItemCount),
|
||||
'fromDate' => $fromDate,
|
||||
'toDate' => $toDate,
|
||||
'details' => $subItems->keyBy('sub_item')
|
||||
]);
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user