resolve the date debug

This commit is contained in:
2025-02-09 14:23:36 +03:30
parent 6cda8f04c6
commit c131e466da
3 changed files with 12 additions and 5 deletions

View File

@@ -71,8 +71,11 @@ class RoadPatrolReportService
return $data;
}
public function countryActivity(string $fromDate, string $toDate): array
public function countryActivity(Request $request): array
{
$fromDate = $request->from_date ? $request->from_date . ' 00:00:00' : now()->startOfDay()->toDateTimeString();
$toDate = $request->date_to ? $request->date_to . ' 23:59:59' : now()->endOfDay()->toDateTimeString();
$activities = DB::select('SELECT
"کشوری" as province_fa,
-1 as province_id,
@@ -124,8 +127,12 @@ class RoadPatrolReportService
];
}
public function provinceActivity(string $fromDate, string $toDate, int $provinceId): array
public function provinceActivity(Request $request): array
{
$fromDate = $request->from_date ? $request->from_date . ' 00:00:00' : now()->startOfDay()->toDateTimeString();
$toDate = $request->date_to ? $request->date_to . ' 23:59:59' : now()->endOfDay()->toDateTimeString();
$provinceId = $request->province_id;
$activities = DB::select(
'SELECT
province_fa,