34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Cartables\Mission;
|
|
|
|
use App\Exceptions\ProhibitedAction;
|
|
use App\Facades\DataTable\DataTableFacade;
|
|
use App\Models\Mission;
|
|
use Illuminate\Http\Request;
|
|
|
|
class TransportationUnitService
|
|
{
|
|
public function dataTable(Request $request)
|
|
{
|
|
$user = auth()->user();
|
|
|
|
$fields = [
|
|
'id','lat','lon', 'recognize_picture','action_picture','created_at','step', 'final_description',
|
|
'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date',
|
|
'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa', 'supervisor_description', 'operator_description'
|
|
];
|
|
|
|
throw_if(is_null($user->edarate_shahri_id), new ProhibitedAction('اداره ای برای شما در سامانه ثبت نشده است!'));
|
|
|
|
$query = Mission::query()->where('', '=', '');
|
|
|
|
return DataTableFacade::run(
|
|
$query,
|
|
$request,
|
|
allowedFilters: ['*'],
|
|
allowedSortings: ['*'],
|
|
allowedSelects: $fields
|
|
);
|
|
}
|
|
} |