图片缓存
This commit is contained in:
@@ -107,14 +107,14 @@ class VehicleController
|
|||||||
$vehicle->fbo_destination = isset($arr[$vehicle->fbo_locations_id]) ? $arr[$vehicle->fbo_locations_id]['name'] : '';
|
$vehicle->fbo_destination = isset($arr[$vehicle->fbo_locations_id]) ? $arr[$vehicle->fbo_locations_id]['name'] : '';
|
||||||
$vehicle->status = $this->status[$vehicle->status]??$this->status[0];
|
$vehicle->status = $this->status[$vehicle->status]??$this->status[0];
|
||||||
if(!str_starts_with($vehicle['img_url'], 'http')){
|
if(!str_starts_with($vehicle['img_url'], 'http')){
|
||||||
$img_url = Cache::get('img_'.$vehicle->id);
|
$img_url = Cache::get('img_dibai_'.$vehicle->id);
|
||||||
if ($img_url) {
|
if ($img_url) {
|
||||||
$vehicle['img_url'] = $img_url;
|
$vehicle['img_url'] = $img_url;
|
||||||
} else {
|
} else {
|
||||||
$ossservice = new OssService();
|
$ossservice = new OssService();
|
||||||
$img_url = $ossservice->generatePrivateUrl($vehicle['img_url'],86400);
|
$img_url = $ossservice->generatePrivateUrl($vehicle['img_url'],86400);
|
||||||
$vehicle['img_url'] = $img_url;
|
$vehicle['img_url'] = $img_url;
|
||||||
Cache::set('img_'.$vehicle->id, $img_url, 86390);
|
Cache::set('img_dibai_'.$vehicle->id, $img_url, 86390);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user