diff --git a/frontend/controllers/CarController.php b/frontend/controllers/CarController.php index dabcfb9..f7e9cb9 100644 --- a/frontend/controllers/CarController.php +++ b/frontend/controllers/CarController.php @@ -612,7 +612,7 @@ class CarController extends BaseController 'HuaHen' => $types[7], 'SiJi' => $types[4], 'ChengKe' => $types[5], - 'CheSun' => $types[1], + 'CheSun' => floatval($types[1]), 'DaoQiang' => $types[3]=='是'?1:0, 'SanZhe' => $types[2], 'ZiRan' => $types[9]=='是'?1:0, @@ -636,13 +636,19 @@ class CarController extends BaseController if($params['HolderIdType'] == '身份证') $params['HolderIdType'] = 1; else $params['HolderIdType'] = 9; - if(floatval($types[1]) > 0 && $types[10] == '是' && $types[11] == '是') { + $min_chesun = floatval($request->input('min_chesun')); + $max_chesun = floatval($request->input('max_chesun')); + + if($params['CheSun'] > 0 && $min_chesun > 0 && $max_chesun > 0 && ($params['CheSun'] < $min_chesun || $params['CheSun'] > $max_chesun)) { + return MyLib::error3('车损只能填写:'.$min_chesun.' ~ '.$max_chesun.' 之间的值'); + } + if($params['CheSun'] > 0 && $types[10] == '是' && $types[11] == '是') { $params['ForceTax'] = 1; } - if(floatval($types[1]) == 0 && $types[10] == '是' && $types[11] == '是') { + if($params['CheSun'] == 0 && $types[10] == '是' && $types[11] == '是') { $params['ForceTax'] = 2; } - if(floatval($types[1]) > 0 && $types[10] == '否' && $types[11] == '否') { + if($params['CheSun'] > 0 && $types[10] == '否' && $types[11] == '否') { $params['ForceTax'] = 0; } switch($types[7]) { diff --git a/frontend/views/car/order-add.php b/frontend/views/car/order-add.php index c131a72..1a19bc3 100644 --- a/frontend/views/car/order-add.php +++ b/frontend/views/car/order-add.php @@ -17,6 +17,8 @@ use common\models\PriceT; + +
保单信息
@@ -477,11 +479,8 @@ use common\models\PriceT; } if(obj.data.VehicleItems[0].DepreciationPrice) { $('#types_1').val(obj.data.VehicleItems[0].DepreciationPrice); - $('#types_1').ionRangeSlider({ - min: obj.data.VehicleItems[0].DownPrice, - max: obj.data.VehicleItems[0].UpPrice, - from: obj.data.VehicleItems[0].DepreciationPrice, - }); + $('#min_chesun').val(obj.data.VehicleItems[0].DownPrice); + $('#max_chesun').val(obj.data.VehicleItems[0].UpPrice); } if(obj.data.VehicleItems[0].VehicleSeat) { $('#seats').val(obj.data.VehicleItems[0].VehicleSeat);