make reports datatable
This commit is contained in:
@@ -23,7 +23,7 @@ class ReportMachineController extends Controller
|
||||
|
||||
public function machineDetailsReport(Request $request, ReportMachineService $reportMachineService,int $machine_id): JsonResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachinesActivity($request,$machine_id);
|
||||
$data = $reportMachineService->machineDetailActivity($request,$machine_id);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class ReportMachineController extends Controller
|
||||
*/
|
||||
public function machineDetailsReportExcel(Request $request, int $machine_id, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachinesActivity($request,$machine_id);
|
||||
$data = $reportMachineService->machineDetailActivity($request,$machine_id);
|
||||
$name = 'گزارش عملکرد ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
|
||||
return Excel::download(new machineDetailsReport($data['data']), $name);
|
||||
@@ -42,10 +42,7 @@ class ReportMachineController extends Controller
|
||||
|
||||
public function machinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||
{
|
||||
return $this->successResponse([
|
||||
'activities' => $reportMachineService->machinesActivity($request),
|
||||
// 'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
return response()->json($reportMachineService->machinesActivity($request));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,9 +59,9 @@ class ReportMachineController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function machineTypeDetailsReport(Request $request, ReportMachineService $reportMachineService,int $car_type): JsonResponse
|
||||
public function machineTypeDetailsReport(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachineTypesActivity($request,$car_type);
|
||||
$data = $reportMachineService->machineTypeDetailActivity($request);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
@@ -73,9 +70,9 @@ class ReportMachineController extends Controller
|
||||
* @throws Exception
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
*/
|
||||
public function machineTypeDetailsReportExcel(Request $request, ReportMachineService $reportMachineService,int $car_type): BinaryFileResponse
|
||||
public function machineTypeDetailsReportExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachineTypesActivity($request,$car_type);
|
||||
$data = $reportMachineService->machineTypeDetailActivity($request);
|
||||
$name = 'گزارش عملکردیک نوع ماشین'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
|
||||
return Excel::download(new machineTypeDetailsReport($data['data']), $name);
|
||||
@@ -83,10 +80,7 @@ class ReportMachineController extends Controller
|
||||
|
||||
public function machineTypesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||
{
|
||||
return $this->successResponse([
|
||||
'activities' => $reportMachineService->machineTypesActivity($request),
|
||||
// 'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
return response()->json($reportMachineService->machineTypesActivity($request));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,9 +95,9 @@ class ReportMachineController extends Controller
|
||||
return Excel::download(new machineTypeReport($data), $name);
|
||||
}
|
||||
|
||||
public function machineDriverDetailsReport(Request $request, int $driver_id, ReportMachineService $reportMachineService): JsonResponse
|
||||
public function machineDriverDetailsReport(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachineDriversActivity($request,$driver_id);
|
||||
$data = $reportMachineService->machineDriverDetailActivity($request);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
@@ -112,9 +106,9 @@ class ReportMachineController extends Controller
|
||||
* @throws Exception
|
||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||
*/
|
||||
public function machineDriverDetailsReportExcel(Request $request, int $driver_id, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
public function machineDriverDetailsReportExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
{
|
||||
$data = $reportMachineService->dataTableMachineDriversActivity($request,$driver_id);
|
||||
$data = $reportMachineService->machineDriverDetailActivity($request);
|
||||
$name = 'گزارش عملکرد راننده'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
|
||||
return Excel::download(
|
||||
@@ -123,10 +117,7 @@ class ReportMachineController extends Controller
|
||||
|
||||
public function machineDriversActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||
{
|
||||
return $this->successResponse([
|
||||
'activities' => $reportMachineService->machineDriversActivity($request),
|
||||
// 'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
return response()->json($reportMachineService->machineDriversActivity($request));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user