车辆详情
This commit is contained in:
@@ -85,7 +85,8 @@ class VehicleDataController extends BaseController
|
||||
];
|
||||
}
|
||||
}
|
||||
return [
|
||||
|
||||
$result = [
|
||||
'id' => $item['id'],
|
||||
'vin' => $item['vin'],
|
||||
'user_nickname' => isset($item['user']) ? $item['user']['nickname'] : '',
|
||||
@@ -100,6 +101,8 @@ class VehicleDataController extends BaseController
|
||||
'vehicle_age' => $item['vehicle_age'],
|
||||
'views' => $item['views'],
|
||||
'is_hot' => $item['is_hot'],
|
||||
'store_status' => $item['store_status'],
|
||||
'store_status_name' => trans(\app\apis\model\VehicleDataModel::STORE_STATUS_VALUE[$item['store_status']]),
|
||||
'name' => isset($item['translation']) ? $item['translation']['name'] : '',
|
||||
'condition_desc' => isset($item['translation']) ? $item['translation']['condition_desc'] : '',
|
||||
'cover' => isset($item['cover']) ? $item['cover'] : '',
|
||||
@@ -115,7 +118,14 @@ class VehicleDataController extends BaseController
|
||||
'location_name' => $item['location'] ? $item['location']['translation']['name'] : '',
|
||||
'location' => is_array($item['location']) ? $item['location']['translation']['location_id'] : $item['location'],
|
||||
];
|
||||
foreach ($arr as $album){
|
||||
$result[$album['field']] = $album['value'];
|
||||
$result[$album['field'].'_full'] = $album['value_full'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
return $item;
|
||||
}
|
||||
@@ -224,4 +234,13 @@ class VehicleDataController extends BaseController
|
||||
return $this->errorResponse($th->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function show(Request $request, int $id, string $scene = 'show'): Response
|
||||
{
|
||||
try {
|
||||
return parent::show($request, $id, $scene);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->errorResponse($th->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user