Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
chenbo 2023-10-18 10:32:00 +08:00
commit b08274f2f7

View File

@ -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;