修复租赁详情页bug
This commit is contained in:
parent
f1a6d17923
commit
1f468b61d2
@ -269,11 +269,13 @@ class VehicleContractController extends BaseAdminController
|
||||
}
|
||||
$data['cars_info'] = json_decode($data['cars_info'],true);
|
||||
$cars = $data['cars_info'];
|
||||
foreach ($cars as $k=>$v) {
|
||||
$rent_info = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||
if(!$rent_info->isEmpty()){
|
||||
$cars[$k]['type'] = $rent_info['type'];
|
||||
$cars[$k]['rent_time'] = !empty($rent_info['rent_time']) ? $rent_info['rent_time'] : $rent_info['create_time'];
|
||||
if(!empty($cars)){
|
||||
foreach ($cars as $k=>$v) {
|
||||
$rent_info = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||
if(!$rent_info->isEmpty()){
|
||||
$cars[$k]['type'] = $rent_info['type'];
|
||||
$cars[$k]['rent_time'] = !empty($rent_info['rent_time']) ? $rent_info['rent_time'] : $rent_info['create_time'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['cars_info'] = $cars;
|
||||
|
Loading…
x
Reference in New Issue
Block a user