change structure of road patrol and route
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\V3\RoadPatrole;
|
||||
|
||||
|
||||
use App\Exports\V3\RoadPatrols\OperatorCartableReport;
|
||||
use App\Exports\V3\RoadPatrols\ProvinceActivity;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
@@ -43,5 +44,16 @@ class OperatorController extends Controller
|
||||
'edarateShahri' => $edarateShahri,
|
||||
]), $name);
|
||||
}
|
||||
public function operatorIndex(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
{
|
||||
$data = $roadPatrolTableService->operatorCartableReport($request);
|
||||
return response()->json($data);
|
||||
}
|
||||
public function operatorCartableReport(Request $request, RoadPatrolTableService $roadPatrolTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات گشت راهداری ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadPatrolTableService->operatorCartableReport($request, true);
|
||||
return Excel::download(new OperatorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user