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

pull/6/head
Rustem 2025-03-25 22:06:35 +05:00
parent 682ef73690
commit f790777bdb
1 changed files with 5 additions and 1 deletions

View File

@ -208,6 +208,10 @@ 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();
$path = null;
if ($mark?->photo_id) {
$path = lurl('/download/'.$mark?->photo_id);
}
$tariffs_new = [];
foreach ($tariffs as $tariff) {
$tariffs_new[] = [
@ -231,7 +235,7 @@ class MobileApiController extends Controller
'engine_capacity' => $mark?->engine_capacity ?? 1591,
'fuel_tank' => $mark?->fuel_tank ?? 50,
'conditioner' => $mark?->conditioner,
'photo' => lurl('/download/'.$mark?->photo_id),
'photo' => $path,
'tariffs' => $tariffs_new
];
}