fix conflict

This commit is contained in:
faezeh
2026-06-27 10:53:31 +03:30
16 changed files with 151 additions and 23 deletions

View File

@@ -21,7 +21,87 @@ class ReportMachineController extends Controller
{
use ApiResponse;
public function machineDetailsReport(Request $request, int $machine_id): array
public function countryMachinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->countryMachinesActivity($request),
// 'provinces' => Province::all(['id', 'name_fa']),
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryMachinesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->countryMachinesActivity($request);
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineReport($data), $name);
}
public function provinceMachinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->provinceMachinesActivity($request),
// 'city' => City::query()
// ->where('province_id', $request->province_id)
// ->where(function ($query) {
// $query->where('type_id', 1)
// ->orWhereIn('name_fa', ['اداره ماشين‌آلات', 'اداره نقلیه']);
// })
// ->get(['id', 'name_fa'])
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function provinceMachinesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->provinceMachinesActivity($request);
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineReport($data), $name);
}
public function countryMachineTypesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->countryMachineTypesActivity($request),
// 'provinces' => Province::all(['id', 'name_fa']),
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->countryMachineTypesActivity($request);
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineTypeReport($data), $name);
}
public function provinceMachineTypesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->provinceMachineTypesActivity($request),
// 'city' => City::query()
// ->where('province_id', $request->province_id)
// ->where(function ($query) {
// $query->where('type_id', 1)
// ->orWhereIn('name_fa', ['اداره ماشين‌آلات', 'اداره نقلیه']);
// })
// ->get(['id', 'name_fa'])
]);
}
public function machineDetailsReport(Request $request, int $machine_id)
{
return DataTableFacade::run(
Mission::query()->where('machine_id', '=', $machine_id),
@@ -34,7 +114,20 @@ class ReportMachineController extends Controller
]
);
}
public function machinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function provinceMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->provinceMachineTypesActivity($request);
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineTypeReport($data), $name);
}
public function countryMachineDriversActivity(Request $request, ReportMachineService $reportMachineService)
{
return $this->successResponse([
'activities' => $reportMachineService->machinesActivity($request),