change name one culum name and prefix some item

This commit is contained in:
2025-05-31 15:16:57 +03:30
parent 73fa6d5ccb
commit e50b9e1113
6 changed files with 38 additions and 17 deletions

View File

@@ -23,6 +23,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;
class OperatorController
{
@@ -40,11 +41,17 @@ class OperatorController
return Excel::download(new OperatorCartableReport($data['data']), $name);
}
/**
* @throws Throwable
*/
public function complaintsIndex(Request $request, OperatorService $operatorService): JsonResponse
{
return response()->json($operatorService->complaintsIndex($request));
}
/**
* @throws Throwable
*/
public function complaintsReport(Request $request, OperatorService $operatorService): BinaryFileResponse
{
$name = 'گزارش از رسیدگی به شکایات واکنش سریع ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';

View File

@@ -6,6 +6,7 @@ use App\Exceptions\ProhibitedAction;
use App\Facades\DataTable\DataTableFacade;
use App\Models\RoadObserved;
use Illuminate\Http\Request;
use Throwable;
class OperatorService
{
@@ -37,15 +38,15 @@ class OperatorService
}
/**
* @throws \Throwable
* @throws Throwable
*/
public function complaintsIndex(Request $request)
{
$user = auth()->user();
$fields = 'fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms, StartTime_DateTime,
$fields = ['fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms, StartTime_DateTime,
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status, edarate_shahri_id,
status_fa, supervisor_description, rms_description, province_fa, city_id, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng';
status_fa, supervisor_description, rms_description, province_fa, city_id, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng'];
if ($user->hasPermissionTo('show-fast-react')) {
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')