From ab9013c32ae174a0718f6c0a829484f567b3c05c Mon Sep 17 00:00:00 2001 From: Rustem Date: Thu, 27 Mar 2025 10:40:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D1=83=D0=B7=D0=BE=D0=B2=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/MobileApiController.php | 4 +- modules/brand_models/app.json | 50 ++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/MobileApiController.php b/app/Http/Controllers/MobileApiController.php index c2d290b..dc7d401 100644 --- a/app/Http/Controllers/MobileApiController.php +++ b/app/Http/Controllers/MobileApiController.php @@ -213,7 +213,7 @@ class MobileApiController extends Controller $tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get(); $equipment = UniModel::model('pipi_auto_equipment')->where('id', $mark->equipment_id)->first(); $class = UniModel::model('pipi_auto_classes')->find($mark->class_id); - $bodywork = UniModel::model('pipi_auto_classes')->find($mark->bodywork_id); + $bodywork = UniModel::model('pipi_auto_bodywork')->find($mark->bodywork_id); $path = null; if ($mark?->photo_id) { @@ -242,7 +242,7 @@ class MobileApiController extends Controller 'engine_capacity' => $mark?->engine_capacity ?? '1591', 'fuel_tank' => $mark?->fuel_tank ?? '50', 'class' => $class->name ?? 'Эконом', - 'bodywork' => $class->name ?? 'Седан', + 'bodywork' => $bodywork->name ?? 'Седан', 'conditioner' => $mark?->conditioner, 'photo' => $path, 'tariffs' => $tariffs_new diff --git a/modules/brand_models/app.json b/modules/brand_models/app.json index 492046f..90c5411 100644 --- a/modules/brand_models/app.json +++ b/modules/brand_models/app.json @@ -63,6 +63,24 @@ ], "validation": "nullable|integer" }, + "class_id": { + "type": "foreign", + "table": "pipi_auto_classes", + "foreign": "id", + "display": [ + "name" + ], + "validation": "nullable|integer" + }, + "bodywork_id": { + "type": "foreign", + "table": "pipi_auto_bodywork", + "foreign": "id", + "display": [ + "name" + ], + "validation": "nullable|integer" + }, "pipi_tariffs": { "type": "subcrud", "module": "pipicar", @@ -313,6 +331,22 @@ "label": "Год" } }, + { + "size": 4, + "input": { + "name": "bodywork_id", + "label": "Кузов", + "readonly": true + } + }, + { + "size": 4, + "input": { + "name": "class_id", + "label": "Класс", + "readonly": true + } + }, { "size": 4, "input": { @@ -411,6 +445,22 @@ "label": "Год" } }, + { + "size": 4, + "input": { + "name": "bodywork_id", + "label": "Кузов", + "readonly": true + } + }, + { + "size": 4, + "input": { + "name": "class_id", + "label": "Класс", + "readonly": true + } + }, { "size": 4, "input": {