update
This commit is contained in:
parent
e57a1d4d60
commit
ceae1ec969
@ -4,6 +4,7 @@ namespace app\adminapi\logic\vehicle;
|
|||||||
use app\common\logic\GpsLogic;
|
use app\common\logic\GpsLogic;
|
||||||
use app\common\model\vehicle\Vehicle;
|
use app\common\model\vehicle\Vehicle;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\vehicle\VehicleRent;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
@ -77,6 +78,12 @@ class VehicleLogic extends BaseLogic
|
|||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$data = Vehicle::findOrEmpty($params['id']);
|
$data = Vehicle::findOrEmpty($params['id']);
|
||||||
|
$data['mileage'] = 0;
|
||||||
|
if($data['status'] == 2){
|
||||||
|
//获取租赁信息
|
||||||
|
$data['rent_info'] = VehicleRent::where('car_id',$data['id'])->find();
|
||||||
|
|
||||||
|
}
|
||||||
return $data->toArray();
|
return $data->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -128,6 +128,7 @@ class IndexController extends BaseApiController
|
|||||||
foreach($vehicle as $v){
|
foreach($vehicle as $v){
|
||||||
$data[] = [
|
$data[] = [
|
||||||
'car_id' => $v['id'],
|
'car_id' => $v['id'],
|
||||||
|
'contract_id' => $contract['id'],
|
||||||
'company_id' => $contract['company_b_id'],
|
'company_id' => $contract['company_b_id'],
|
||||||
'company_name' => $contract['company_b_name'],
|
'company_name' => $contract['company_b_name'],
|
||||||
'company_user' => $contract['company_b_user'],
|
'company_user' => $contract['company_b_user'],
|
||||||
|
@ -78,6 +78,7 @@ class VehicleController extends BaseApiController
|
|||||||
]);
|
]);
|
||||||
$vehicleRent = VehicleRent::create([
|
$vehicleRent = VehicleRent::create([
|
||||||
'car_id'=> $vehicle->id,
|
'car_id'=> $vehicle->id,
|
||||||
|
'contract_id' => 0,
|
||||||
'company_id' => $params['company_id'],
|
'company_id' => $params['company_id'],
|
||||||
'company_name' => $params['company_name'],
|
'company_name' => $params['company_name'],
|
||||||
'company_user' => $params['company_user'],
|
'company_user' => $params['company_user'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user