Доработка апи
parent
682ef73690
commit
f790777bdb
|
|
@ -208,6 +208,10 @@ class MobileApiController extends Controller
|
||||||
$tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get();
|
$tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get();
|
||||||
$equipment = UniModel::model('pipi_auto_equipment')->where('id', $mark->equipment_id)->first();
|
$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 = [];
|
$tariffs_new = [];
|
||||||
foreach ($tariffs as $tariff) {
|
foreach ($tariffs as $tariff) {
|
||||||
$tariffs_new[] = [
|
$tariffs_new[] = [
|
||||||
|
|
@ -231,7 +235,7 @@ class MobileApiController extends Controller
|
||||||
'engine_capacity' => $mark?->engine_capacity ?? 1591,
|
'engine_capacity' => $mark?->engine_capacity ?? 1591,
|
||||||
'fuel_tank' => $mark?->fuel_tank ?? 50,
|
'fuel_tank' => $mark?->fuel_tank ?? 50,
|
||||||
'conditioner' => $mark?->conditioner,
|
'conditioner' => $mark?->conditioner,
|
||||||
'photo' => lurl('/download/'.$mark?->photo_id),
|
'photo' => $path,
|
||||||
'tariffs' => $tariffs_new
|
'tariffs' => $tariffs_new
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue