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

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, 'hp' => $mark?->hp,
'engine_capacity' => $mark?->engine_capacity, 'engine_capacity' => $mark?->engine_capacity,
'fuel_tank' => $mark?->fuel_tank, 'fuel_tank' => $mark?->fuel_tank,
'conditioner' => $mark?->conditioner,
'tariffs' => $tariffs_new 'tariffs' => $tariffs_new
]; ];
} }

View File

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