Merge pull request #8 from witelgroup/feature/FixLastCode
Feature/fix last code
This commit is contained in:
@@ -38,8 +38,10 @@ class OperatorController extends Controller
|
|||||||
public function store(Mission $mission): JsonResponse
|
public function store(Mission $mission): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($mission) {
|
DB::transaction(function () use ($mission) {
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
$road_patrol = RoadPatrol::query()->create([
|
$road_patrol = RoadPatrol::query()->create([
|
||||||
|
'operator_id' => $user->id,
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
'status_fa' => 'در حال بررسی',
|
'status_fa' => 'در حال بررسی',
|
||||||
'province_id' => $mission->province_id,
|
'province_id' => $mission->province_id,
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ class OperatorService
|
|||||||
public function dataTable(Request $request, $loadRelations = false)
|
public function dataTable(Request $request, $loadRelations = false)
|
||||||
{
|
{
|
||||||
$query = RoadPatrol::query()
|
$query = RoadPatrol::query()
|
||||||
->where('operator_id', '=', auth()->user()->id)
|
->where('operator_id', '=', auth()->user()->id);
|
||||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
// ->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||||
|
|
||||||
return DataTableFacade::run(
|
return DataTableFacade::run(
|
||||||
$query,
|
$query,
|
||||||
|
|||||||
Reference in New Issue
Block a user