add rahdar id to road item project
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Http\Traits\ApiResponse;
|
||||
use App\Models\CMMSMachine;
|
||||
use App\Models\EdarateShahri;
|
||||
use App\Models\InfoItem;
|
||||
use App\Models\Rahdaran;
|
||||
use App\Models\RoadItemsProject;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -195,6 +196,7 @@ class RoadItemsProjectController extends Controller
|
||||
$start_coordinates = explode(',', $request->start_point);
|
||||
$end_coordinates = $info_item->needs_end_point ? explode(',', $request->end_point) : null;
|
||||
$cmmsMachine = CMMSMachine::query()->find($request->cmms_machine_id);
|
||||
$rahdar = Rahdaran::query()->find($request->rahdar_id);
|
||||
|
||||
$attributes = [
|
||||
'start_lat' => $start_coordinates[0],
|
||||
@@ -225,6 +227,8 @@ class RoadItemsProjectController extends Controller
|
||||
'activity_time' => $request->activity_time,
|
||||
'cmms_machine_id' => $cmmsMachine->id,
|
||||
'cmms_machine_code' => $cmmsMachine->machine_code,
|
||||
'rahdar_id' => $rahdar->id,
|
||||
'rahdar_code' => $rahdar->code,
|
||||
];
|
||||
|
||||
$after_image = ($request->has('after_image') && $info_item->needs_image) ?
|
||||
@@ -271,6 +275,7 @@ class RoadItemsProjectController extends Controller
|
||||
}
|
||||
|
||||
$cmmsMachine = CMMSMachine::query()->find($request->cmms_machine_id);
|
||||
$rahdar = Rahdaran::query()->find($request->rahdar_id);
|
||||
|
||||
if ($info_item->needs_image) {
|
||||
if ($request->has('after_image')) {
|
||||
@@ -308,6 +313,8 @@ class RoadItemsProjectController extends Controller
|
||||
'status_fa' => 'در حال بررسی',
|
||||
'cmms_machine_id' => $cmmsMachine->id,
|
||||
'cmms_machine_code' => $cmmsMachine->machine_code,
|
||||
'rahdar_id' => $rahdar->id,
|
||||
'rahdar_code' => $rahdar->code,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user