diff --git a/api/controllers/wxapp/app/Business.php b/api/controllers/wxapp/app/Business.php index a773ad9b..aa1fb28a 100644 --- a/api/controllers/wxapp/app/Business.php +++ b/api/controllers/wxapp/app/Business.php @@ -31,7 +31,7 @@ class Business extends Wxapp{ $color_id = $this->input_param('color_id'); $main_type = $this->input_param('main_type'); $oid = $this->input_param('oid'); - $biz = $this->biz_model->get(['id'=>$biz_id],'city_id'); + $biz = $this->biz_model->get(['id'=>$biz_id],'id,city_id'); $city_id = $biz['city_id']; $where = [ 's_id'=>$s_id, @@ -89,6 +89,9 @@ class Business extends Wxapp{ $car['price_car'] = $row['price_car']; $car['price_floor'] = $row['price_floor']; $dis_money = $car['price_car'] - $car['price_floor']; + if($biz['id']==160){ + $dis_money = 200000; + } $where_car = array( 's_id'=>$s_id, diff --git a/api/controllers/wxapp/licheb/CusorderV2.php b/api/controllers/wxapp/licheb/CusorderV2.php index 9cab93d7..89c79dc7 100644 --- a/api/controllers/wxapp/licheb/CusorderV2.php +++ b/api/controllers/wxapp/licheb/CusorderV2.php @@ -133,13 +133,15 @@ class CusorderV2 extends Wxapp if (!$car_row) { throw new Exception('参数错误', API_CODE_FAIL); } - $can_dis_money = $business_row['price_car'] - $business_row['price_floor']; //可优惠金额 - if ($can_dis_money > 0) { - if ($disc_money && $business_row['price_floor'] > $business_row['price_car'] - $disc_money) { - throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL); + if($biz['id']!=160){ + $can_dis_money = $business_row['price_car'] - $business_row['price_floor']; //可优惠金额 + if ($can_dis_money > 0) { + if ($disc_money && $business_row['price_floor'] > $business_row['price_car'] - $disc_money) { + throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL); + } + } else { + if ($disc_money) throw new Exception('当前车型没有优惠额度', API_CODE_FAIL); } - } else { - if ($disc_money) throw new Exception('当前车型没有优惠额度', API_CODE_FAIL); } if (!$payway && $finance_id) { //分期 $finance_row = $this->sys_finance_model->get(['id' => $finance_id, 'status' => 1]); @@ -386,13 +388,15 @@ class CusorderV2 extends Wxapp if ($deposit < 1000) { throw new Exception('定金不得少于1000', ERR_PARAMS_ERROR); } - $can_dis_money = $business_row['price_car'] - $business_row['price_floor']; //可优惠金额 - if ($can_dis_money > 0) { - if ($disc_money && $car_row['price_floor'] > $car_row['price_car'] - $disc_money) { - throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL); + if($biz['id']!=160){ + $can_dis_money = $business_row['price_car'] - $business_row['price_floor']; //可优惠金额 + if ($can_dis_money > 0) { + if ($disc_money && $car_row['price_floor'] > $car_row['price_car'] - $disc_money) { + throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL); + } + } else { + if ($disc_money) throw new Exception('当前车型没有优惠额度', API_CODE_FAIL); } - } else { - if ($disc_money) throw new Exception('当前车型没有优惠额度', API_CODE_FAIL); } if (!$payway && $finance_id) { //分期 $finance_row = $this->sys_finance_model->get(['id' => $finance_id, 'status' => 1]); @@ -1115,13 +1119,12 @@ class CusorderV2 extends Wxapp protected function ck_money($money_json, $srv_arr, $biz) { if($biz['id']==160){ - return true; -// $ff_price = $money_json['fee_carno'] + $money_json['price_finance']; -// if($ff_price>0){ -// return true; -// }else{ -// throw new Exception('上牌和金融不得低于0', ERR_PARAMS_ERROR); -// } + $ff_price = $money_json['fee_carno'] + $money_json['price_finance']; + if($ff_price>0){ + return true; + }else{ + throw new Exception('上牌和金融不得低于0', ERR_PARAMS_ERROR); + } } if ($biz['id'] == 70) { $fee_carno_limit = 700;