img
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace app\controller;
|
namespace app\controller;
|
||||||
|
|
||||||
use app\model\Vehicle;
|
use app\model\Vehicle;
|
||||||
|
use app\service\OssService;
|
||||||
use plugin\admin\app\model\Location;
|
use plugin\admin\app\model\Location;
|
||||||
use util\Util;
|
use util\Util;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
@@ -40,6 +41,12 @@ class VehicleController
|
|||||||
// $vehicle->final_location_name = $final_location ? $final_location->name : '';
|
// $vehicle->final_location_name = $final_location ? $final_location->name : '';
|
||||||
$fbo_location = Location::find($vehicle->fbo_locations_id);
|
$fbo_location = Location::find($vehicle->fbo_locations_id);
|
||||||
$vehicle->fbo_destination = $fbo_location ? $fbo_location->name : '';
|
$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)];
|
$result = ['list' => $vehicles,'count'=>count($vehicles)];
|
||||||
return Util::success($result);
|
return Util::success($result);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace plugin\admin\app\controller;
|
namespace plugin\admin\app\controller;
|
||||||
|
|
||||||
|
use app\service\OssService;
|
||||||
use plugin\admin\app\model\Location;
|
use plugin\admin\app\model\Location;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
@@ -127,6 +128,13 @@ class VehicleController extends Crud
|
|||||||
$fbo_location = Location::find($item->fbo_locations_id);
|
$fbo_location = Location::find($item->fbo_locations_id);
|
||||||
$item->fbo_location_name = $fbo_location ? $fbo_location->name : '';
|
$item->fbo_location_name = $fbo_location ? $fbo_location->name : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!str_starts_with($items->url, 'http')){
|
||||||
|
$ossservice = new OssService();
|
||||||
|
$img_url = $ossservice->generatePrivateUrl($item->img_url,86400);
|
||||||
|
$item->img_url = $img_url;
|
||||||
|
}
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user