create new postision for report
This commit is contained in:
@@ -17,30 +17,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
class SupervisorController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
public function countryPatrolActivity(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
{
|
||||
$activities = $roadPatrolTableService->countryActivity($request);
|
||||
|
||||
$provinces = Province::all(['id', 'name_fa']);
|
||||
|
||||
return $this->successResponse([
|
||||
'activities' => $activities['data'],
|
||||
'provinces' => $provinces
|
||||
]);
|
||||
}
|
||||
public function countryActivityExcel(Request $request, RoadPatrolTableService $roadPatrolTableService): BinaryFileResponse
|
||||
{
|
||||
$activities = $roadPatrolTableService->countryActivity($request);
|
||||
$provinces = Province::all(['id', 'name_fa']);
|
||||
|
||||
$name = 'گزارش از گشت راهداری و ترابری ' . verta()->now()->format('Y-m-d H-i') . '.xlsx';
|
||||
|
||||
return Excel::download(new CountryActivity([
|
||||
'activities' => $activities,
|
||||
'provinces' => $provinces,
|
||||
]), $name);
|
||||
}
|
||||
public function supervisorIndex(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
public function index(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
{
|
||||
$data = $roadPatrolTableService->supervisorCartableReport($request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user