车辆详情
This commit is contained in:
@@ -85,7 +85,8 @@ class VehicleDataController extends BaseController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [
|
|
||||||
|
$result = [
|
||||||
'id' => $item['id'],
|
'id' => $item['id'],
|
||||||
'vin' => $item['vin'],
|
'vin' => $item['vin'],
|
||||||
'user_nickname' => isset($item['user']) ? $item['user']['nickname'] : '',
|
'user_nickname' => isset($item['user']) ? $item['user']['nickname'] : '',
|
||||||
@@ -100,6 +101,8 @@ class VehicleDataController extends BaseController
|
|||||||
'vehicle_age' => $item['vehicle_age'],
|
'vehicle_age' => $item['vehicle_age'],
|
||||||
'views' => $item['views'],
|
'views' => $item['views'],
|
||||||
'is_hot' => $item['is_hot'],
|
'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'] : '',
|
'name' => isset($item['translation']) ? $item['translation']['name'] : '',
|
||||||
'condition_desc' => isset($item['translation']) ? $item['translation']['condition_desc'] : '',
|
'condition_desc' => isset($item['translation']) ? $item['translation']['condition_desc'] : '',
|
||||||
'cover' => isset($item['cover']) ? $item['cover'] : '',
|
'cover' => isset($item['cover']) ? $item['cover'] : '',
|
||||||
@@ -115,7 +118,14 @@ class VehicleDataController extends BaseController
|
|||||||
'location_name' => $item['location'] ? $item['location']['translation']['name'] : '',
|
'location_name' => $item['location'] ? $item['location']['translation']['name'] : '',
|
||||||
'location' => is_array($item['location']) ? $item['location']['translation']['location_id'] : $item['location'],
|
'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;
|
return $item;
|
||||||
}
|
}
|
||||||
@@ -224,4 +234,13 @@ class VehicleDataController extends BaseController
|
|||||||
return $this->errorResponse($th->getMessage());
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ class VehicleDataService extends BaseService
|
|||||||
'fields' => [
|
'fields' => [
|
||||||
'id','vin','price','cover',
|
'id','vin','price','cover',
|
||||||
'type','energy','model','mileage','vehicle_age',
|
'type','energy','model','mileage','vehicle_age',
|
||||||
'views','is_hot','created_at','updated_at', 'brand', 'model', 'user_id', 'location'
|
'views','is_hot','created_at','updated_at', 'brand', 'model', 'user_id', 'store_status', 'location'
|
||||||
],
|
],
|
||||||
'relations' => [
|
'relations' => [
|
||||||
'translation' => ['vehicle_id', 'name','condition_desc'],
|
'translation' => ['vehicle_id', 'name','condition_desc'],
|
||||||
|
|||||||
Reference in New Issue
Block a user