曾超新 5 years ago
parent 4fabdef56e
commit 36f7d869db
  1. 6
      frontend/controllers/CarController.php
  2. 15
      frontend/views/car/order-add.php

@ -552,6 +552,12 @@ class CarController extends BaseController
]); ]);
if($res->getStatusCode() == 200) { if($res->getStatusCode() == 200) {
$obj = json_decode($res->getBody()); $obj = json_decode($res->getBody());
if($obj->data && $obj->data->UserInfo && $obj->data->CarUsedType != '') {
$car_user_info = CarUseT::where('name', $obj->data->CarUsedType)->first();
if($car_user_info) {
$obj->data->CarUsedType = $car_user_info->id;
}
}
return MyLib::ok3($obj->data); return MyLib::ok3($obj->data);
} }
return MyLib::error3($res->getBody()); return MyLib::error3($res->getBody());

@ -25,7 +25,7 @@ use common\models\PriceT;
<th class="bg-warning" nowrap>初登日期</th> <th class="bg-warning" nowrap>初登日期</th>
<td><input name="register_date" class="form-control date" style="width:100%;" type="text" value="<?=$car_info->register_date?>"></td> <td><input name="register_date" class="form-control date" style="width:100%;" type="text" value="<?=$car_info->register_date?>"></td>
<th class="bg-warning" nowrap>座位数</th> <th class="bg-warning" nowrap>座位数</th>
<td><input name="seats" class="form-control" style="width:100%;" type="text" value="<?=$order_info->seats ? $order_info->seats:$car_info->seats?>"></td> <td><input name="seats" id="seats" class="form-control" style="width:100%;" type="text" value="<?=$order_info->seats ? $order_info->seats:$car_info->seats?>"></td>
<th class="bg-warning" nowrap>电子邮件</th> <th class="bg-warning" nowrap>电子邮件</th>
<td><input name="email" class="form-control" style="width:100%;" type="text" value="<?=$order_info->email?>"></td> <td><input name="email" class="form-control" style="width:100%;" type="text" value="<?=$order_info->email?>"></td>
</tr> </tr>
@ -348,6 +348,19 @@ use common\models\PriceT;
function getCarInfo() { function getCarInfo() {
$.get('/car/bihu-carinfo?id=<?=$car_info->id?>',function(obj) { $.get('/car/bihu-carinfo?id=<?=$car_info->id?>',function(obj) {
console.log(obj); console.log(obj);
if(obj.code == 200) {
if(obj.data.UserInfo) {
if(obj.data.UserInfo.NextBusinessStartDate) {
$('#insurer1_begin_date').val(obj.data.UserInfo.NextBusinessStartDate);
}
if(obj.data.UserInfo.NextForceStartDate) {
$('#insurer2_begin_date').val(obj.data.UserInfo.NextForceStartDate);
}
if(obj.data.UserInfo.CarUsedType) {
$('#car_use_id').val(obj.data.UserInfo.CarUsedType);
}
}
}
}, 'json'); }, 'json');
} }
//获取策略 //获取策略

Loading…
Cancel
Save