管理页面
This commit is contained in:
@@ -3,11 +3,14 @@
|
||||
namespace app\controller;
|
||||
|
||||
use app\model\Vehicle;
|
||||
use app\util\Util;
|
||||
use plugin\admin\app\model\Location;
|
||||
use util\Util;
|
||||
use support\Request;
|
||||
|
||||
class VehicleController
|
||||
{
|
||||
|
||||
protected $status = ['未知','待发车','在途(发往fbo港口)','抵达发货港口','在途(发往目的地仓库)','抵达仓库','售出'];
|
||||
/**
|
||||
* Mask VIN number by showing only first 2 and last 6 characters
|
||||
*/
|
||||
@@ -29,6 +32,14 @@ class VehicleController
|
||||
if (isset($vehicle->vin)) {
|
||||
$vehicle->vin = $this->maskVin($vehicle->vin);
|
||||
}
|
||||
|
||||
$vehicle->status = $this->status[$vehicle->status]??$this->status[0];
|
||||
// $location = Location::find($vehicle->locations_id);
|
||||
// $vehicle->location_name = $location ? $location->name : '';
|
||||
// $final_location = Location::find($vehicle->final_locations_id);
|
||||
// $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 : '';
|
||||
});
|
||||
$result = ['list' => $vehicles,'count'=>count($vehicles)];
|
||||
return Util::success($result);
|
||||
|
||||
Reference in New Issue
Block a user