Доработка апи

pull/6/head
Rustem 2025-03-25 15:50:51 +05:00
parent a1e88818aa
commit 25249c10b1
3 changed files with 26 additions and 2 deletions

View File

@ -225,6 +225,7 @@ class MobileApiController extends Controller
'hp' => $mark?->hp,
'engine_capacity' => $mark?->engine_capacity,
'fuel_tank' => $mark?->fuel_tank,
'conditioner' => $mark?->conditioner,
'tariffs' => $tariffs_new
];
}

View File

@ -37,6 +37,9 @@
"year": {
"type": "string"
},
"conditioner": {
"type": "boolean"
},
"brand_id": {
"type": "foreign",
"table": "pipi_auto_brands",
@ -333,7 +336,7 @@
"size": 2,
"input": {
"name": "hp",
"label": "Лошадиные силы"
"label": "Мощность л.с"
}
},
{
@ -349,6 +352,13 @@
"name": "fuel_tank",
"label": "Объем топливного бака"
}
},
{
"size": 2,
"input": {
"name": "conditioner",
"label": "Кондиционер"
}
}
]
}
@ -415,7 +425,7 @@
"size": 2,
"input": {
"name": "hp",
"label": "Лошадиные силы"
"label": "Мощность л.с"
}
},
{
@ -431,6 +441,13 @@
"name": "fuel_tank",
"label": "Объем топливного бака"
}
},
{
"size": 2,
"input": {
"name": "conditioner",
"label": "Кондиционер"
}
}
]
},

View File

@ -49,6 +49,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->string('fuel_tank')->nullable()->comment('Объем топливного бака');
});
}
if (!Schema::connection($segment->connector)->hasColumn('pipi_brand_models', 'conditioner')) {
Schema::connection($segment->connector)->table('pipi_brand_models', function ($table) {
$table->boolean('conditioner')->default(true)->comment('Кондиционер');
});
}
}
}
};