This commit is contained in:
2025-04-30 14:00:54 +08:00
parent 65b1d6ba67
commit 1da9389dc5
2 changed files with 15 additions and 0 deletions
+7
View File
@@ -3,6 +3,7 @@
namespace app\controller;
use app\model\Vehicle;
use app\service\OssService;
use plugin\admin\app\model\Location;
use util\Util;
use support\Request;
@@ -40,6 +41,12 @@ class VehicleController
// $vehicle->final_location_name = $final_location ? $final_location->name : '';
$fbo_location = Location::find($vehicle->fbo_locations_id);
$vehicle->fbo_destination = $fbo_location ? $fbo_location->name : '';
if(!str_starts_with($vehicle->url, 'http')){
$ossservice = new OssService();
$img_url = $ossservice->generatePrivateUrl($vehicle->img_url,86400);
$vehicle->img_url = $img_url;
}
});
$result = ['list' => $vehicles,'count'=>count($vehicles)];
return Util::success($result);