edit-api-create_order
This commit is contained in:
@@ -105,6 +105,7 @@ class Orders extends HD_Controller
|
||||
$money_json = json_decode($row['money_json'], true);
|
||||
$deposit = $row['deposit'];
|
||||
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
|
||||
$row['price_discount'] = $money_json['price_discount'];
|
||||
$row['info_json'] = json_decode($row['info_json'], true);
|
||||
$row['status'] = intval($row['status']);
|
||||
$row['price'] = number_format($row['price'], 2);
|
||||
|
||||
@@ -23,7 +23,10 @@
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">车辆售价:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.price}}</label>
|
||||
<label class="am-para-label-con">
|
||||
{{info.price}}
|
||||
<span class="text-danger" v-if="info.price_discount">(优惠金额:{{info.price_discount}})</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
@@ -51,7 +54,7 @@
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">服务费:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con" v-if="info.srv_info">{{info.srv_info.total}}({{info.srv_info.detail}})</label>
|
||||
<label class="am-para-label-con" v-if="info.srv_info">{{info.srv_info.total}}<template v-if="info.srv_info.detail">({{info.srv_info.detail}}</template></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
|
||||
@@ -180,28 +180,33 @@ class Xzcall extends HD_Controller
|
||||
}
|
||||
}
|
||||
|
||||
//更新订单金融服务费
|
||||
public function up_srv_money()
|
||||
{
|
||||
$o_id = $this->input->get('id');
|
||||
$show = $this->input->get('show');
|
||||
$money = $this->input->get('money');
|
||||
$row = $this->orders_model->get(['id' => $o_id]);
|
||||
if (!$row) {
|
||||
return false;
|
||||
}
|
||||
if ($show) {
|
||||
print_r($row);
|
||||
}
|
||||
if ($money) {
|
||||
$money_json = json_decode($row['money_json'], true);
|
||||
$money_json['price_finance'] = 0;
|
||||
$up_data = [
|
||||
'money_json' => json_encode($money_json, JSON_UNESCAPED_UNICODE)
|
||||
];
|
||||
$res = $this->orders_model->update($up_data, ['id' => $row['id']]);
|
||||
var_dump($res);
|
||||
|
||||
//更新订单服务id
|
||||
public function up_srv_ids(){
|
||||
$this->load->model('receiver/receiver_service_package_model','package_model');
|
||||
$page = $this->input->get('page');
|
||||
$size = $this->input->get('size');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 20;
|
||||
$where = [
|
||||
'pack_id>' => 0,
|
||||
'srv_ids' => ''
|
||||
];
|
||||
$rows = $this->orders_model->select($where,'id asc',$page,$size);
|
||||
if($rows){
|
||||
foreach($rows as $item){
|
||||
$pack = $this->package_model->get(['id'=>$item['pack_id']]);
|
||||
$res = false;
|
||||
if($pack){
|
||||
$updata = [
|
||||
'srv_ids' => $pack['srv_ids']
|
||||
];
|
||||
$res = $this->orders_model->update($updata,['id'=>$item['id']]);
|
||||
}
|
||||
$log = "{$item['id']}更新结果:{$res}</br>";
|
||||
echo $log;
|
||||
}
|
||||
}else{
|
||||
echo "finish";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,8 @@ class Series extends Wxapp{
|
||||
}
|
||||
$data = [
|
||||
'price' => $car['price_car'] ? $car['price_car'] : 0,
|
||||
'deposit' => $car['price_book'] ? $car['price_book'] : 0
|
||||
'deposit' => $car['price_book'] ? $car['price_book'] : 0,
|
||||
'dis_money' => $car['price_car'] - $car['price_floor']
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ class Contract extends Wxapp{
|
||||
$next_path = ''; //下一步合同
|
||||
switch($type){
|
||||
case 0: //整车
|
||||
$next_path = '/pages/mine/signContract/daiLi?id='.$row['id'];
|
||||
$row['srv_ids'] && $next_path = '/pages/mine/signContract/daiLi?id='.$row['id'];
|
||||
break;
|
||||
case 1: //协议
|
||||
break;
|
||||
case 4://车辆买卖合同补充协议
|
||||
$opt_row = $this->receiver_order_oplogs_model->select(['order_id'=>$row['id'],'type'=>3],'id desc',1,1);//最后修改日志
|
||||
$opt_row = json_decode($opt_row[0]['log_json'],true);
|
||||
if($opt_row['pack_id']!=$row['pack_id']){
|
||||
if($opt_row['srv_ids']!=$row['srv_ids']){
|
||||
//需要签服务补充协议
|
||||
$next_path = '/pages/mine/signContract/weiTuoBu?id='.$row['id'];
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class Contract extends Wxapp{
|
||||
$img = $this->input_param('img');
|
||||
|
||||
$row = $this->contracts_model->get(['type'=>$type,'o_id'=>$id]);
|
||||
$order = $this->orders_model->get(['id'=>$id],'brand_id,biz_id,ifentrust,pack_id,info_json');
|
||||
$order = $this->orders_model->get(['id'=>$id],'brand_id,biz_id,ifentrust,srv_ids,info_json');
|
||||
if(!$row['file'] || !$img){
|
||||
throw new Exception('参数错误', API_CODE_INVILD_PARAM);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class Contract extends Wxapp{
|
||||
switch($type){
|
||||
case 0: //整车
|
||||
$sign_img = array_pop($imgs);
|
||||
$height = $order['ifentrust'] ? 480 : 380;
|
||||
$height = $order['ifentrust'] ? 610 : 520;
|
||||
$jsondata['c_cardid'] && $height += 30;
|
||||
$res = $sign_entity->merge($sign_img,$img,1070,$height,230);
|
||||
if(!$res){
|
||||
@@ -176,6 +176,9 @@ class Contract extends Wxapp{
|
||||
];
|
||||
$result = $this->contracts_model->update($update,['id'=>$row['id']]);
|
||||
if($result){
|
||||
if(!$order['srv_ids']){
|
||||
$this->orders_entity->sign_after_v2($id,$this->session);
|
||||
}
|
||||
$redis->delete($cache_key);
|
||||
throw new Exception('签名成功', API_CODE_SUCCESS);
|
||||
}else{
|
||||
@@ -184,8 +187,7 @@ class Contract extends Wxapp{
|
||||
break;
|
||||
case 1: //协议
|
||||
$sign_img = array_pop($imgs);
|
||||
$package = $this->package_model->get(['id'=>$order['pack_id']],'srv_ids');
|
||||
$srv_count = $package ? count(explode(',',$package['srv_ids'])) : 0;
|
||||
$srv_count = $order['srv_ids'] ? count(explode(',',$order['srv_ids'])) : 0;
|
||||
$height = $order['ifentrust'] ? 1400 : 1280;
|
||||
$jsondata['c_cardid'] && $height += 30;
|
||||
$height += $srv_count*52;
|
||||
@@ -277,7 +279,7 @@ class Contract extends Wxapp{
|
||||
$redis->delete($cache_key);
|
||||
$opt_row = $this->receiver_order_oplogs_model->select(['order_id'=>$id,'type'=>3],'id desc',1,1);//最后修改日志
|
||||
$opt_row = json_decode($opt_row[0]['log_json'],true);
|
||||
if($opt_row['pack_id']==$order['pack_id']){
|
||||
if($opt_row['srv_ids']==$order['srv_ids']){
|
||||
//不需要签服务补充协议 完成重新补充协议签约
|
||||
$this->orders_entity->finish_sp($id);
|
||||
}
|
||||
|
||||
@@ -272,6 +272,8 @@ class User extends Wxapp{
|
||||
$agent_count = $this->receiver_order_contracts_model->count(['o_id'=>$row['id'],'type' => 5,'status'=>1]); //服务补充协议
|
||||
$opt_row = $this->receiver_order_oplogs_model->select(['order_id'=>$row['id'],'type'=>3],'id desc',1,1);//最后修改日志
|
||||
$opt_row = json_decode($opt_row[0]['log_json'],true);
|
||||
$opt_money_json = json_decode($opt_row['money_json'],true);
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$this->load->library('receiver/orders_entity');
|
||||
foreach($progress_arr as $key=>$val){
|
||||
$imgs = [];
|
||||
@@ -289,11 +291,10 @@ class User extends Wxapp{
|
||||
$state = 0;
|
||||
if(!$sign_row['status']){//未签名
|
||||
if($sign_count>=2){ //需要签补充协议
|
||||
$diff_key_arr = ['s_id','v_id','cor_id','incor_id','pack_id']; //修改其中一项需要签补充协议
|
||||
if($opt_row['s_id']!=$row['s_id'] || $opt_row['v_id']!=$row['v_id'] || $opt_row['cor_id']!=$row['cor_id'] || $opt_row['incor_id']!=$row['incor_id'] || $opt_row['payway']!=$row['payway']){
|
||||
if($opt_row['s_id']!=$row['s_id'] || $opt_row['v_id']!=$row['v_id'] || $opt_row['cor_id']!=$row['cor_id'] || $opt_row['incor_id']!=$row['incor_id'] || $opt_row['payway']!=$row['payway'] || $money_json['price_discount']!=$opt_money_json['price_discount']){
|
||||
$need_resign_car = true; //需要签合同补充协议
|
||||
}
|
||||
if($opt_row['pack_id']!=$row['pack_id']){
|
||||
if($opt_row['srv_ids']!=$row['srv_ids']){
|
||||
$need_resign_agent = true; //需要签服务补充协议
|
||||
}
|
||||
if($need_resign_car && !$car_count){
|
||||
|
||||
@@ -26,6 +26,7 @@ class Cusorder extends Wxapp{
|
||||
$this->load->model('receiver/order/receiver_order_ckcars_model','order_ckcars_model');
|
||||
$this->load->model('receiver/order/receiver_order_contracts_model','order_contracts_model');
|
||||
|
||||
$this->load->model('receiver/receiver_fine_model');
|
||||
$this->load->model('receiver/receiver_services_model','services_model');
|
||||
$this->load->model('receiver/receiver_service_package_model','package_model');
|
||||
|
||||
@@ -56,7 +57,7 @@ class Cusorder extends Wxapp{
|
||||
|
||||
//创建订单
|
||||
protected function post(){
|
||||
|
||||
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
$cus_id = $this->input_param('cus_id');
|
||||
$car_id = $this->input_param('car_id');
|
||||
$color_id = $this->input_param('color_id');
|
||||
@@ -65,7 +66,6 @@ class Cusorder extends Wxapp{
|
||||
$price = $this->input_param('price');
|
||||
$deposit = $this->input_param('deposit');
|
||||
$payway = $this->input_param('payway');
|
||||
$pack_id = $this->input_param('pack_id');
|
||||
$main_type = $this->input_param('main_type');
|
||||
$ifentrust = $this->input_param('ifentrust');
|
||||
$entrust_name = $this->input_param('entrust_name');
|
||||
@@ -78,6 +78,9 @@ class Cusorder extends Wxapp{
|
||||
$delry_time = $this->input_param('delry_time');
|
||||
$finance_id = $this->input_param('finance_id');
|
||||
$inten_money = floatval($this->input_param('inten_money'));//意向金
|
||||
$disc_money = floatval($this->input_param('disc_money'));//优惠金额
|
||||
$srv_ids = $this->input_param('srv_ids');
|
||||
$fine_ids = $this->input_param('fine_ids');
|
||||
|
||||
$row = $this->customers_model->get(['id'=>$cus_id]);
|
||||
$series_row = $this->auto_series_model->get(['id'=>$car_id]);
|
||||
@@ -90,6 +93,12 @@ class Cusorder extends Wxapp{
|
||||
if($inten_money > $deposit){
|
||||
throw new Exception('意向金不得高于定金', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']],'city_id,type');
|
||||
if($biz['type'] == 1 || $biz['type']==2){ //直营店必须选择一个代办
|
||||
if(!count($srv_ids)){
|
||||
throw new Exception('请选择代办项目', ERR_PARAMS_ERROR);
|
||||
}
|
||||
}
|
||||
//判断是否存在未完成流程
|
||||
$omobile = $mobile ? $mobile : $row['mobile'];
|
||||
$o_order = $this->orders_model->get_step($omobile);
|
||||
@@ -101,6 +110,17 @@ class Cusorder extends Wxapp{
|
||||
if(!$car_row){
|
||||
throw new Exception('参数错误', API_CODE_FAIL);
|
||||
}
|
||||
$total_dis_money = $disc_money; //总优惠金额包含精品
|
||||
if(is_array($fine_ids) && $fine_ids){
|
||||
$fine_id_str = implode(',',$fine_ids);
|
||||
$fine_rows = $this->receiver_fine_model->select(["id in ({$fine_id_str})" => null],'','','','id,price');
|
||||
foreach($fine_rows as $item){
|
||||
$total_dis_money += $item['price'];
|
||||
}
|
||||
}
|
||||
if($disc_money && $car_row['price_floor'] > $price-$total_dis_money){
|
||||
throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL);
|
||||
}
|
||||
if(!$payway){ //分期
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$finance_id,'status'=>1]);
|
||||
if(!$finance_row){
|
||||
@@ -128,12 +148,8 @@ class Cusorder extends Wxapp{
|
||||
'c_id' => $color_id,
|
||||
'inc_id' => $incolor_id,
|
||||
'v_id' => $v_id,
|
||||
'color' => isset($color_row) ? $color_row : '',
|
||||
'incolor' => isset($incolor_row) ? $incolor_row : '',
|
||||
'version' => isset($version_row) ? $version_row : ''
|
||||
];
|
||||
|
||||
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
$data = [
|
||||
'rid' => $cus_id,
|
||||
'sid' => create_order_no(350200,$this->app_key),
|
||||
@@ -152,9 +168,10 @@ class Cusorder extends Wxapp{
|
||||
'c_time' => time()
|
||||
];
|
||||
$payway && $data['payway'] = 1;
|
||||
$pack_id && $data['pack_id'] = $pack_id;
|
||||
$main_type && $data['main_type'] = 1;
|
||||
$delry_time && $data['delry_time'] = $delry_time;
|
||||
$srv_ids && $data['srv_ids'] = implode(',',$srv_ids);
|
||||
$fine_ids && $data['fine_ids'] = implode(',',$fine_ids);
|
||||
$info_json = [];
|
||||
if($ifentrust){
|
||||
$data['ifentrust'] = 1;
|
||||
@@ -171,20 +188,16 @@ class Cusorder extends Wxapp{
|
||||
'price_book' => $car_row['price_book'],
|
||||
'price_insure' => $car_row['price_insure'],
|
||||
'price_fine' => $car_row['price_fine'],
|
||||
'price_discount' =>$disc_money ? $disc_money : 0
|
||||
];
|
||||
if(!$payway){
|
||||
if($series_row['brand_id']==4){ //哪吒品牌 金融服务费2000
|
||||
$money_json['price_finance'] = 2000;
|
||||
}else{
|
||||
$orders_entity = new Orders_entity();
|
||||
$money_json['price_finance'] = $orders_entity::PRICE_FINANCE;
|
||||
}
|
||||
$orders_entity = new Orders_entity();
|
||||
$money_json['price_finance'] = $series_row['brand_id'] == 4 ? $orders_entity::PRICE_FINANCE_NZ : $orders_entity::PRICE_FINANCE;
|
||||
}
|
||||
//获取挂牌价
|
||||
if($series_row['brand_id']==3){ //狸车品牌写死挂牌费用0.01 测试用
|
||||
$money_json['fee_carno'] = 0.01;
|
||||
}else{
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']],'city_id');
|
||||
$city = $this->sys_city_model->get(['city_id'=>$biz['city_id']],'fee_carno');
|
||||
$money_json['fee_carno'] = $city['fee_carno'];
|
||||
}
|
||||
@@ -373,10 +386,8 @@ class Cusorder extends Wxapp{
|
||||
$loan_status = $loan['status']>0 ? 2 : 1;
|
||||
}
|
||||
$pack_title = '';
|
||||
if($row['pack_id']){
|
||||
$pack_row = $this->package_model->get(['id'=>$row['pack_id']]);
|
||||
$srv_rows = '';
|
||||
$pack_row['srv_ids'] && $srv_rows = $this->services_model->select(["id in ({$pack_row['srv_ids']})"=>null],'','','','title');
|
||||
if($row['srv_ids']){
|
||||
$srv_rows = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','title');
|
||||
$srv_rows && $pack_title = implode('+',array_column($srv_rows,'title'));
|
||||
}
|
||||
$car_data = [
|
||||
@@ -396,8 +407,8 @@ class Cusorder extends Wxapp{
|
||||
}
|
||||
$info_json['c_address'] && $car_data['地址'] = $info_json['c_address'];
|
||||
$info_json['c_cardid'] && $car_data['身份证号'] = $info_json['c_cardid'];
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
if(!$row['payway']){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$row['finance_id']],'title');
|
||||
$car_data['金融产品'] = $finance_row['title'];
|
||||
}
|
||||
@@ -459,7 +470,11 @@ class Cusorder extends Wxapp{
|
||||
'entrust_name' => $info_json['entrust_name'] ? $info_json['entrust_name']:'',
|
||||
'entrust_idcard' => $info_json['entrust_idcard'] ? $info_json['entrust_idcard']:'',
|
||||
'delry_time' => $row['delry_time']!='0000-00-00 00:00:00' ? date('Y-m-d',strtotime($row['delry_time'])):'',
|
||||
'finance_id' => !$row['payway'] ? $row['finance_id'] : ''
|
||||
'finance_id' => !$row['payway'] ? $row['finance_id'] : '',
|
||||
'disc_money' => $money_json['price_discount'] ? $money_json['price_discount'] : '',
|
||||
'srv_ids' => $row['srv_ids'] ? explode(',',$row['srv_ids']) : [],
|
||||
'fine_ids' => $row['fine_ids'] ? explode(',',$row['fine_ids']) : [],
|
||||
'cus_id' => $row['rid']
|
||||
];
|
||||
$inten_money && $data['inten_money'] = $inten_money;
|
||||
return $data;
|
||||
|
||||
@@ -21,6 +21,7 @@ class Cusorder2 extends Wxapp{
|
||||
$this->load->model('receiver/receiver_customers_model','customers_model');
|
||||
$this->load->model('receiver/order/receiver_orders_model','orders_model');
|
||||
$this->load->model('receiver/order/receiver_order_contracts_model');
|
||||
$this->load->model('receiver/receiver_fine_model');
|
||||
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_attr_model');
|
||||
@@ -133,6 +134,9 @@ class Cusorder2 extends Wxapp{
|
||||
$main_type = $this->input_param('main_type');
|
||||
$delry_time = $this->input_param('delry_time');
|
||||
$finance_id = $this->input_param('finance_id');
|
||||
$disc_money = floatval($this->input_param('disc_money'));//优惠金额
|
||||
$srv_ids = $this->input_param('srv_ids');
|
||||
$fine_ids = $this->input_param('fine_ids');
|
||||
|
||||
$row = $this->orders_model->get(['id'=>$id]);
|
||||
$series_row = $this->auto_series_model->get(['id'=>$car_id]);
|
||||
@@ -143,6 +147,23 @@ class Cusorder2 extends Wxapp{
|
||||
if($row['status']>2){ //车辆确认后不可修改
|
||||
throw new Exception('修改失败,信息不可修改', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']],'type');
|
||||
if($biz['type'] == 1 || $biz['type']==2){ //直营店必须选择一个代办
|
||||
if(!count($srv_ids)){
|
||||
throw new Exception('请选择代办项目', ERR_PARAMS_ERROR);
|
||||
}
|
||||
}
|
||||
$total_dis_money = $disc_money; //总优惠金额包含精品
|
||||
if(is_array($fine_ids) && $fine_ids){
|
||||
$fine_id_str = implode(',',$fine_ids);
|
||||
$fine_rows = $this->receiver_fine_model->select(["id in ({$fine_id_str})" => null],'','','','id,price');
|
||||
foreach($fine_rows as $item){
|
||||
$total_dis_money += $item['price'];
|
||||
}
|
||||
}
|
||||
if($disc_money && $car_row['price_floor'] > $car_row['price_car']-$total_dis_money){
|
||||
throw new Exception('车辆售价不得低于车辆底价,请重新填写优惠信息', API_CODE_FAIL);
|
||||
}
|
||||
if(!$payway){ //分期
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$finance_id,'status'=>1]);
|
||||
if(!$finance_row){
|
||||
@@ -185,6 +206,8 @@ class Cusorder2 extends Wxapp{
|
||||
'price' => $car_row['price_car'],
|
||||
'deposit' => $car_row['price_book'],
|
||||
'payway' => $payway ? 1 : 0,
|
||||
'srv_ids' => implode(',',$srv_ids),
|
||||
'fine_ids' => implode(',',$fine_ids)
|
||||
];
|
||||
$pack_id && $data['pack_id'] = $pack_id;
|
||||
$main_type && $data['main_type'] = 1;
|
||||
@@ -197,13 +220,10 @@ class Cusorder2 extends Wxapp{
|
||||
$money_json['price_book'] = $car_row['price_book'];
|
||||
$money_json['price_insure'] = $car_row['price_insure'];
|
||||
$money_json['price_fine'] = $car_row['price_fine'];
|
||||
$money_json['price_discount'] = $disc_money;
|
||||
$orders_entity = new Orders_entity();
|
||||
if(!$payway){
|
||||
if($series_row['brand_id']==4){ //哪吒品牌 金融服务费2000
|
||||
$money_json['price_finance'] = 2000;
|
||||
}else{
|
||||
$money_json['price_finance'] = $orders_entity::PRICE_FINANCE;
|
||||
}
|
||||
$money_json['price_finance'] = $series_row['brand_id'] == 4 ? $orders_entity::PRICE_FINANCE_NZ : $orders_entity::PRICE_FINANCE;
|
||||
}
|
||||
$data['money_json'] = json_encode($money_json,JSON_UNESCAPED_UNICODE);
|
||||
|
||||
|
||||
@@ -382,6 +382,7 @@ class Customers extends Wxapp
|
||||
$name = $this->input_param('name');
|
||||
$mobile = $this->input_param('mobile');
|
||||
$cf_clues = $this->input_param('cf_clues');//线索来源
|
||||
$admin_id = $this->input_param('admin_id');
|
||||
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 10;
|
||||
@@ -422,6 +423,7 @@ class Customers extends Wxapp
|
||||
}
|
||||
}
|
||||
$unuse && $where['admin_id'] = 0;
|
||||
$admin_id && $where['admin_id'] = $admin_id;
|
||||
strlen($istop) && $where['is_top'] = $istop;
|
||||
strlen($if_driver) && $where['if_driver'] = 1;
|
||||
strlen($status) && $where['status'] = $status;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Created by Vim
|
||||
* User: lcc
|
||||
* Date: 2021/10/29
|
||||
* Time: 15:34
|
||||
*/
|
||||
require_once APPPATH.'controllers/wxapp/Wxapp.php';
|
||||
class Fine extends Wxapp{
|
||||
|
||||
function __construct($inputs, $app_key){
|
||||
parent::__construct($inputs, $app_key);
|
||||
|
||||
$this->login_white = array();//登录白名单
|
||||
$this->check_status = array();//用户状态校验
|
||||
$this->check_mobile = array();//需要手机号
|
||||
$this->check_headimg =array();//授权微信信息
|
||||
|
||||
$this->load->model('receiver/receiver_fine_model');
|
||||
|
||||
}
|
||||
|
||||
protected function get(){
|
||||
$page = $this->input_param('page');
|
||||
$size = $this->input_param('size');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 20;
|
||||
|
||||
$where = [
|
||||
'status' => 1
|
||||
];
|
||||
$count = $this->receiver_fine_model->count($where);
|
||||
$list = $this->receiver_fine_model->select($where,'id desc',$page,$size,'id,title,price');
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,9 +17,11 @@ class Protocol extends CI_Controller{
|
||||
$this->load->model('receiver/order/receiver_order_agents_model','agents_model');
|
||||
$this->load->model('receiver/order/receiver_order_loans_model','loans_model');
|
||||
$this->load->model('receiver/order/receiver_order_ckcars_model','ckcars_model');
|
||||
$this->load->model('receiver/order/receiver_order_oplogs_model');
|
||||
|
||||
$this->load->model('receiver/receiver_fine_model');
|
||||
$this->load->model('receiver/receiver_service_package_model','package_model');
|
||||
$this->load->model('receiver/receiver_services_model','services_model');
|
||||
$this->load->model('receiver/order/receiver_order_oplogs_model');
|
||||
|
||||
$this->load->model('auto/auto_series_model');
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
@@ -29,7 +31,6 @@ class Protocol extends CI_Controller{
|
||||
$this->load->model('area_model');
|
||||
$this->load->model("sys/sys_company_model");
|
||||
$this->load->model("items/items_model");
|
||||
$this->load->model('apporder/order_purchase_model','purchase_model');
|
||||
$this->load->model('app/liche/app_liche_orders_model');
|
||||
|
||||
$wxapp = $this->input->get('wxapp');
|
||||
@@ -42,6 +43,8 @@ class Protocol extends CI_Controller{
|
||||
$row = $this->orders_model->get(['id'=>$id]);
|
||||
$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>0]);
|
||||
if($row){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$money_json['price_discount'] && $row['price'] = $row['price'] - $money_json['price_discount'];
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
|
||||
@@ -56,14 +59,12 @@ class Protocol extends CI_Controller{
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
|
||||
$city = $this->area_model->get(['county_id'=>$biz['county_id']],'city_name,county_name');
|
||||
$row['address'] = $city['city_name'].$city['county_name'].' '.$biz['address'] .'  '. $biz['biz_name'];
|
||||
if($row['brand_id']==4){ //哪吒品牌 公司固定厦门狸车销售公司
|
||||
$biz['company_id'] = 1;
|
||||
}
|
||||
$row['brand_id'] == 4 && $biz['company_id'] = 1; //哪吒品牌 公司固定厦门狸车销售公司
|
||||
|
||||
$company = $this->sys_company_model->get(['id'=>$biz['company_id']]);
|
||||
$row['company'] = $company;
|
||||
//获取选择代办包
|
||||
$pack_row = $this->package_model->get(['id'=>$row['pack_id']],'srv_ids');
|
||||
$srv_total = count(explode(',',$pack_row['srv_ids']));
|
||||
$srv_total = count(explode(',',$row['srv_ids']));
|
||||
if($srv_total==4){
|
||||
$row['give_time'] = 30;
|
||||
}elseif($srv_total==3){
|
||||
@@ -71,6 +72,13 @@ class Protocol extends CI_Controller{
|
||||
}else{
|
||||
$row['give_time'] = 60;
|
||||
}
|
||||
//获取精品
|
||||
$fine_title = '无';
|
||||
if($row['fine_ids']){
|
||||
$fine_rows = $this->receiver_fine_model->select(["id in ({$row['fine_ids']})"=>null],'','','','title');
|
||||
$fine_title = implode(',',array_column($fine_rows,'title'));
|
||||
}
|
||||
$row['fine_title'] = $fine_title;
|
||||
}
|
||||
$row['info_json'] = json_decode($row['info_json'],true);
|
||||
$row['price_rmb'] = num_to_rmb($row['price']);
|
||||
@@ -92,10 +100,8 @@ class Protocol extends CI_Controller{
|
||||
//获取门店信息
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
|
||||
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
|
||||
//获取选择代办包
|
||||
$pack_row = $this->package_model->get(['id'=>$row['pack_id']],'srv_ids');
|
||||
if($pack_row['srv_ids']){
|
||||
$services = $this->services_model->select(["id in ({$pack_row['srv_ids']})"=>null],'','','','title');
|
||||
if($row['srv_ids']){
|
||||
$services = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','title');
|
||||
}
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$srv_price = $this->orders_entity->order_srv_money($row['id']);
|
||||
@@ -144,13 +150,14 @@ class Protocol extends CI_Controller{
|
||||
$items = $this->items_model->get(['id'=>$row['item_id']],'vin');
|
||||
$total_price = 0;
|
||||
if($row){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$money_json['price_discount'] && $row['price'] = $row['price'] - $money_json['price_discount'];
|
||||
//贷款
|
||||
if(!$row['payway']){
|
||||
$row['loan'] = $this->loans_model->get(['o_id'=>$id]);
|
||||
}
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$row['info_json'] = $info_json = json_decode($row['info_json'],true);
|
||||
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
|
||||
$color = $this->auto_attr_model->get(['id'=>$row['cor_id']],'title');
|
||||
@@ -201,6 +208,9 @@ class Protocol extends CI_Controller{
|
||||
$row['old_contract'] = $this->contracts_model->get(['o_id'=>$id,'type'=>0]); //买卖合同
|
||||
$contract = $this->contracts_model->get(['o_id'=>$id,'type'=>4]);
|
||||
if($row){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$money_json['price_discount'] && $row['price'] = $row['price'] - $money_json['price_discount'];
|
||||
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
$version = $this->auto_attr_model->get(['id'=>$row['v_id']],'title');
|
||||
@@ -221,8 +231,7 @@ class Protocol extends CI_Controller{
|
||||
$company = $this->sys_company_model->get(['id'=>$biz['company_id']]);
|
||||
$row['company'] = $company;
|
||||
//获取选择代办包
|
||||
$pack_row = $this->package_model->get(['id'=>$row['pack_id']],'srv_ids');
|
||||
$srv_total = count(explode(',',$pack_row['srv_ids']));
|
||||
$srv_total = count(explode(',',$row['srv_ids']));
|
||||
if($srv_total==4){
|
||||
$row['give_time'] = 30;
|
||||
}elseif($srv_total==3){
|
||||
@@ -234,16 +243,25 @@ class Protocol extends CI_Controller{
|
||||
//修改信息
|
||||
$opt_row = $this->receiver_order_oplogs_model->select(['order_id'=>$row['id'],'type'=>3],'id desc',1,1);//最后修改日志
|
||||
$opt_row = json_decode($opt_row[0]['log_json'],true);
|
||||
$opt_money_json = json_decode($opt_row['money_json'],true);
|
||||
$opt_money_json['price_discount'] && $opt_row['price'] - $opt_money_json['price_discount'];
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$money_json['price_discount'] && $row['price'] - $money_json['price_discount'];
|
||||
$b_price = num_to_rmb($row['price']);
|
||||
$price = number_format($row['price'],2);
|
||||
$logs = [];
|
||||
if($opt_row){
|
||||
$diff_key_arr = ['s_id','v_id','cor_id','incor_id'];
|
||||
$diff_car = false;
|
||||
$diff_price = $diff_car = false;
|
||||
foreach($diff_key_arr as $item){
|
||||
if($opt_row[$item]!=$row[$item]){
|
||||
$diff_car = true;
|
||||
$diff_price = $diff_car = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($money_json['price_discount']!=$opt_money_json['price_discount']){
|
||||
$diff_price = true;
|
||||
}
|
||||
if($diff_car){
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
@@ -265,11 +283,11 @@ class Protocol extends CI_Controller{
|
||||
$old_incor = $attr_rows[$opt_row['incor_id']] ? $attr_rows[$opt_row['incor_id']][0]['title'] : '';
|
||||
$new_car = "{$brand['name']}{$series['name']}{$version}{$cor}{$incor}";
|
||||
$old_car = "{$old_brand['name']}{$old_series['name']}{$old_version}{$old_car}{$old_incor}";
|
||||
$b_price = num_to_rmb($row['price']);
|
||||
$price = number_format($row['price'],2);
|
||||
$logs[0] = "购买车型由 {$old_car} 变更为 {$new_car}
|
||||
<div>车辆单价:{$price} 元 数量:1</div>
|
||||
<div>车辆总价:{$price}元,{$b_price} </div>";
|
||||
}
|
||||
if($diff_price){
|
||||
$old_price = number_format($opt_row['price'],2);
|
||||
$logs[] = "车辆单价由 {$old_price} 变更为 {$price} 车辆总价:{$price}元, {$b_price}";
|
||||
}
|
||||
@@ -303,22 +321,13 @@ class Protocol extends CI_Controller{
|
||||
//获取门店信息
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
|
||||
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
|
||||
//获取选择代办包
|
||||
$pack_ids[] = $row['pack_id'];
|
||||
$pack_ids[] = $opt_row['pack_id'];
|
||||
$pack_ids_str = implode(',',$pack_ids);
|
||||
$pack_rows = $this->package_model->map('id','',["id in ($pack_ids_str)"=>null],'','','','id,srv_ids');
|
||||
if($pack_rows){
|
||||
$srv_ids_str = $pack_rows[$row['pack_id']][0]['srv_ids'];
|
||||
if($srv_ids_str){
|
||||
$service_rows = $this->services_model->select(["id in ({$srv_ids_str})"=>null],'','','','title');
|
||||
$services = implode(',',array_column($service_rows,'title'));
|
||||
}
|
||||
$old_srv_ids_str = $pack_rows[$opt_row['pack_id']][0]['srv_ids'];
|
||||
if($old_srv_ids_str){
|
||||
$service_rows = $this->services_model->select(["id in ({$old_srv_ids_str})"=>null],'','','','title');
|
||||
$old_services = implode(',',array_column($service_rows,'title'));
|
||||
}
|
||||
if($row['srv_ids']){
|
||||
$service_rows = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','title');
|
||||
$services = implode(',',array_column($service_rows,'title'));
|
||||
}
|
||||
if($opt_row['srv_ids']){
|
||||
$service_rows = $this->services_model->select(["id in ({$opt_row['srv_ids']})"=>null],'','','','title');
|
||||
$old_services = implode(',',array_column($service_rows,'title'));
|
||||
}
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$srv_price = $this->orders_entity->order_srv_money($row['id']);
|
||||
|
||||
@@ -15,6 +15,59 @@ class Services extends Wxapp{
|
||||
$this->login_white = array('get_package');//登录白名单
|
||||
$this->load->model('receiver/receiver_services_model','services_model');
|
||||
$this->load->model('receiver/receiver_service_package_model','package_model');
|
||||
$this->load->model('receiver/receiver_customers_model','customers_model');
|
||||
|
||||
$this->load->model('auto/auto_cars_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->model('sys/sys_city_model');
|
||||
$this->load->library('receiver/orders_entity');
|
||||
}
|
||||
protected function get(){ //获取服务
|
||||
$cus_id = $this->input_param('cus_id');
|
||||
$s_id = $this->input_param('car_id');
|
||||
$v_id = $this->input_param('v_id');
|
||||
$payway = $this->input_param('payway');
|
||||
|
||||
$row = $this->customers_model->get(['id'=>$cus_id],'biz_id');
|
||||
$car_row = $this->auto_cars_model->get(['s_id'=>$s_id,'v_id'=>$v_id,'status'=>1]);
|
||||
$where = [];
|
||||
$payway && $where['id !='] = 4; //全款不显示金融
|
||||
$count = $this->services_model->count($where);
|
||||
$list = [];
|
||||
if($count){
|
||||
$price_arr = [
|
||||
'price_insure' => floatval($car_row['price_insure']),
|
||||
'price_fine' => floatval($car_row['price_fine']),
|
||||
];
|
||||
|
||||
$orders_entity = new Orders_entity();
|
||||
$price_arr['price_finance'] = $car_row['brand_id'] ==4 ? $orders_entity::PRICE_FINANCE_NZ : $orders_entity::PRICE_FINANCE;
|
||||
|
||||
//获取挂牌价
|
||||
if($car_row['brand_id']==3){ //狸车品牌写死挂牌费用0.01 测试用
|
||||
$price_arr['fee_carno'] = 0.01;
|
||||
}else{
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']],'id,city_id');
|
||||
$city = $this->sys_city_model->get(['city_id'=>$biz['city_id']],'fee_carno');
|
||||
$price_arr['fee_carno'] = floatval($city['fee_carno']);
|
||||
}
|
||||
|
||||
$rows = $this->services_model->select($where,'','','','id,title,field_name');
|
||||
foreach($rows as $key=>$val){
|
||||
$field_arr = explode('.',$val['field_name']);
|
||||
$list[] = [
|
||||
'id' => $val['id'],
|
||||
'title' => $val['title'],
|
||||
'price' => $price_arr[$field_arr[1]] ? $price_arr[$field_arr[1]] : 0
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
//服务包
|
||||
protected function get_package(){
|
||||
|
||||
@@ -101,7 +101,7 @@ class User extends Wxapp
|
||||
|
||||
$user = $this->app_user_model->get(array('id' => $uid));
|
||||
//获取所属店铺字段
|
||||
$biz = $this->biz_model->get(['id' => $biz_id, 'status' => 1], 'biz_name');
|
||||
$biz = $this->biz_model->get(['id' => $biz_id, 'status' => 1], 'biz_name,type');
|
||||
//判断门店是否存在
|
||||
if (!$biz && $this->session['group_id'] < 4) {
|
||||
$this->logout();
|
||||
@@ -126,7 +126,8 @@ class User extends Wxapp
|
||||
'group_id' => $user['group_id'],
|
||||
'group_name' => $group_name,
|
||||
'biz_id' => $biz_id,
|
||||
'biz_name' => $biz['biz_name'] ? $biz['biz_name'] : ''
|
||||
'biz_name' => $biz['biz_name'] ? $biz['biz_name'] : '',
|
||||
'biz_type' => $biz['type'] ? $biz['type'] : ''
|
||||
);
|
||||
|
||||
return $data;
|
||||
@@ -335,6 +336,9 @@ class User extends Wxapp
|
||||
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 10;
|
||||
if(!$biz_id){
|
||||
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
}
|
||||
$where = [
|
||||
'status' => 1,
|
||||
'biz_id' => $biz_id
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div>车辆单价为车身单价,续航里程为300KM以上的车辆已按扣减国家补贴后的价格结算。不包含车辆购置税、车辆保险费、挂牌杂费等其他费用。乙方如需委托甲方代理上牌、委托运输等服务的,双方应另外签订《委托服务协议》。</div>
|
||||
<div><b>第三条付款方式</b></div>
|
||||
<div><b>第三条 付款方式</b></div>
|
||||
<div>乙方在签订合同时即付定金人民币:<?=$dep_price?>元,定金在结算时冲抵车款。</div>
|
||||
<div>乙方选择<?=$payway?'一次性付款方式':'分期付款方式'?></div>
|
||||
<div><b>第四条 车辆交付</b></div>
|
||||
@@ -86,9 +86,11 @@
|
||||
<div>5、备注:如乙方购买续航里程为300KM以上车辆,上牌性质是公户或营运车辆需确保购买车辆自行驶证注册日期起1年之内行驶2万公里,且至车辆注册之日起2年内不得过户,如因违反此条约使甲方在申领国补过程中造成的损失,一切责任及后果由乙方承担。</div>
|
||||
<div><b>第五条 车辆确认</b></div>
|
||||
<div>车辆确认以甲、乙双方签署的《车辆信息确认单》为准。《车辆信息确认单》自签署之日起,该车辆的风险责任从甲方转移至乙方。</div>
|
||||
<div><b>第六条 车辆验收</b></div>
|
||||
<div><b>第六条 双方特别约定</b></div>
|
||||
<div>随车赠送 <?=$fine_title?></div>
|
||||
<div><b>第七条 车辆验收</b></div>
|
||||
<div>甲方向乙方交付汽车及随车文件时应当场验收。乙方应对所购车辆进行认真检查、确认。如有异议,应当场提出。验收完毕,双方需签署《车辆交付表》,即为该车辆正式交付。</div>
|
||||
<div><b>第七条 质量、维修、更换、退车</b></div>
|
||||
<div><b>第八条 质量、维修、更换、退车</b></div>
|
||||
<div>1、甲方向乙方出售的车辆,应当不存在危及人身、财产安全的不合理的危险,符合保障人体健康和人身、财产安全的国家标准、行业标准,具备产品应当具备的使用性能等,符合注明采用的产品标准,符合以产品、实物样品等方式表明的质量状况。符合出厂检验标准,符合安全驾驶和说明书载明的使用要求。双方另有约定的情形除外。 </div>
|
||||
<div>2、甲方向乙方出售的车辆,必须是经国家有关部门公布、备案的汽车产品公告上的产品或合法进口的产品,并符合公安交通管理部门关于机动车辆的注册登记条件。</div>
|
||||
<div>3、甲方保证向乙方出售的车辆,在交付前已作必要的检查和清洁,并按生产厂的技术要求完成交车前检查(PDI/PDS)并排除已发现的汽车故障或瑕疵。</div>
|
||||
@@ -98,16 +100,16 @@
|
||||
<div>7、乙方所购汽车如在保修期内出现质量问题,甲方(生产厂)应明确承担维修任务的维修站(厂)负责免费维修。</div>
|
||||
<div>8、以上条款未尽事宜,按照国家有关汽车产品修理、更换、退货的规定、机动车维修管理规定和生产厂的有关汽车产品修理、更换、退货的规定和操作流程执行。</div>
|
||||
<div>9、乙方所购车辆如属生产厂公布的汽车召回范围,甲方应当召回。</div>
|
||||
<div><b>第八条 不可抗力</b></div>
|
||||
<div><b>第九条 不可抗力</b></div>
|
||||
<div>任何一方因不可抗力的原因,致使车辆不能交接或逾期交接的,可免除违约责任。遇有不可抗力的一方,应负有及时通知并在10日内提供不能履行合同的书面证明。</div>
|
||||
<div><b>第九条 违约责任</b></div>
|
||||
<div><b>第十条 违约责任</b></div>
|
||||
<div>除本同第八条规定的特殊情况外:</div>
|
||||
<div>1、若甲方逾期交车,自逾期之日起至实际交付之日,甲方按日向乙方支付车价款万分之伍的违约金,合同继续履行,逾期超过陆拾天,乙方有权解除合同。合同解除后,甲方应当自乙方解除合同之日起陆拾日内退还已付款。</div>
|
||||
<div>2、若乙方逾期付款,自逾期之日起至实际支付之日,乙方按日向甲方支付车价款万分之伍的违约金,合同继续履行,逾期超过陆拾天,甲方有权解除合同。</div>
|
||||
<div>3、经甲乙双方约定的或有关行政部门依法认定的汽车检验机构鉴定乙方所购汽车存在设计、制造缺陷,造成的人身、财产损害的,甲方应依法承担责任。</div>
|
||||
<div><b>第十条 争议的解决方式</b></div>
|
||||
<div><b>第十一条 争议的解决方式</b></div>
|
||||
<div>甲、乙双方在履行本合同过程中发生争议,应协商解决,也可请求消费者协会或其他机构调解。协商不能解决或调解不成的,依法向甲方所在地人民法院起诉。</div>
|
||||
<div><b>第十一条 其他</b></div>
|
||||
<div><b>第十二条 其他</b></div>
|
||||
<div>1、双方应保证在合同中填写的姓名、地址、电话等内容真实有效,若有改变,应及时书面通知对方,否则由此造成的损失及相关责任由变更方负责。本合同约定的联系地址和联系方式,亦可作为司法送达的法定地址。</div>
|
||||
<div>2、本合同的未尽事宜及本合同在履行过程中需变更的事宜,双方可通过订立补充条款或补充协议进行约定。补充条款、补充协议及附件均为不可分割的部分。</div>
|
||||
<div>3、本合同及其补充条款、补充协议及附件中的手写文字与打印文字有矛盾时,以手写文字为准。如阿拉伯数字与大写数字有矛盾时,以大写数字为准。 </div>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div>车辆单价为车身单价,续航里程为300KM以上的车辆已按扣减国家补贴后的价格结算。不包含车辆购置税、车辆保险费、挂牌杂费等其他费用。乙方如需委托甲方代理上牌、委托运输等服务的,双方应另外签订《委托服务协议》。</div>
|
||||
<div><b>第三条付款方式</b></div>
|
||||
<div><b>第三条 付款方式</b></div>
|
||||
<div>乙方在签订合同时即付定金人民币:<?=$dep_price?>元,定金在结算时冲抵车款。</div>
|
||||
<div>乙方选择<?=$payway?'一次性付款方式':'分期付款方式'?></div>
|
||||
<div><b>第四条 车辆交付</b></div>
|
||||
@@ -90,9 +90,11 @@
|
||||
<div>5、备注:如乙方购买续航里程为300KM以上车辆,上牌性质是公户或营运车辆需确保购买车辆自行驶证注册日期起1年之内行驶2万公里,且至车辆注册之日起2年内不得过户,如因违反此条约使甲方在申领国补过程中造成的损失,一切责任及后果由乙方承担。</div>
|
||||
<div><b>第五条 车辆确认</b></div>
|
||||
<div>车辆确认以甲、乙双方签署的《车辆信息确认单》为准。《车辆信息确认单》自签署之日起,该车辆的风险责任从甲方转移至乙方。</div>
|
||||
<div><b>第六条 车辆验收</b></div>
|
||||
<div><b>第六条 双方特别约定</b></div>
|
||||
<div>随车赠送 <?=$fine_title?></div>
|
||||
<div><b>第七条 车辆验收</b></div>
|
||||
<div>甲方向乙方交付汽车及随车文件时应当场验收。乙方应对所购车辆进行认真检查、确认。如有异议,应当场提出。验收完毕,双方需签署《车辆交付表》,即为该车辆正式交付。</div>
|
||||
<div><b>第七条 质量、维修、更换、退车</b></div>
|
||||
<div><b>第八条 质量、维修、更换、退车</b></div>
|
||||
<div>1、甲方向乙方出售的车辆,应当不存在危及人身、财产安全的不合理的危险,符合保障人体健康和人身、财产安全的国家标准、行业标准,具备产品应当具备的使用性能等,符合注明采用的产品标准,符合以产品、实物样品等方式表明的质量状况。符合出厂检验标准,符合安全驾驶和说明书载明的使用要求。双方另有约定的情形除外。 </div>
|
||||
<div>2、甲方向乙方出售的车辆,必须是经国家有关部门公布、备案的汽车产品公告上的产品或合法进口的产品,并符合公安交通管理部门关于机动车辆的注册登记条件。</div>
|
||||
<div>3、甲方保证向乙方出售的车辆,在交付前已作必要的检查和清洁,并按生产厂的技术要求完成交车前检查(PDI/PDS)并排除已发现的汽车故障或瑕疵。</div>
|
||||
@@ -102,16 +104,16 @@
|
||||
<div>7、乙方所购汽车如在保修期内出现质量问题,甲方(生产厂)应明确承担维修任务的维修站(厂)负责免费维修。</div>
|
||||
<div>8、以上条款未尽事宜,按照国家有关汽车产品修理、更换、退货的规定、机动车维修管理规定和生产厂的有关汽车产品修理、更换、退货的规定和操作流程执行。</div>
|
||||
<div>9、乙方所购车辆如属生产厂公布的汽车召回范围,甲方应当召回。</div>
|
||||
<div><b>第八条 不可抗力</b></div>
|
||||
<div><b>第九条 不可抗力</b></div>
|
||||
<div>任何一方因不可抗力的原因,致使车辆不能交接或逾期交接的,可免除违约责任。遇有不可抗力的一方,应负有及时通知并在10日内提供不能履行合同的书面证明。</div>
|
||||
<div><b>第九条 违约责任</b></div>
|
||||
<div><b>第十条 违约责任</b></div>
|
||||
<div>除本同第八条规定的特殊情况外:</div>
|
||||
<div>1、若甲方逾期交车,自逾期之日起至实际交付之日,甲方按日向乙方支付车价款万分之伍的违约金,合同继续履行,逾期超过陆拾天,乙方有权解除合同。合同解除后,甲方应当自乙方解除合同之日起陆拾日内退还已付款。</div>
|
||||
<div>2、若乙方逾期付款,自逾期之日起至实际支付之日,乙方按日向甲方支付车价款万分之伍的违约金,合同继续履行,逾期超过陆拾天,甲方有权解除合同。</div>
|
||||
<div>3、经甲乙双方约定的或有关行政部门依法认定的汽车检验机构鉴定乙方所购汽车存在设计、制造缺陷,造成的人身、财产损害的,甲方应依法承担责任。</div>
|
||||
<div><b>第十条 争议的解决方式</b></div>
|
||||
<div><b>第十一条 争议的解决方式</b></div>
|
||||
<div>甲、乙双方在履行本合同过程中发生争议,应协商解决,也可请求消费者协会或其他机构调解。协商不能解决或调解不成的,依法向甲方所在地人民法院起诉。</div>
|
||||
<div><b>第十一条 其他</b></div>
|
||||
<div><b>第十二条 其他</b></div>
|
||||
<div>1、双方应保证在合同中填写的姓名、地址、电话等内容真实有效,若有改变,应及时书面通知对方,否则由此造成的损失及相关责任由变更方负责。本合同约定的联系地址和联系方式,亦可作为司法送达的法定地址。</div>
|
||||
<div>2、本合同的未尽事宜及本合同在履行过程中需变更的事宜,双方可通过订立补充条款或补充协议进行约定。补充条款、补充协议及附件均为不可分割的部分。</div>
|
||||
<div>3、本合同及其补充条款、补充协议及附件中的手写文字与打印文字有矛盾时,以手写文字为准。如阿拉伯数字与大写数字有矛盾时,以大写数字为准。 </div>
|
||||
|
||||
@@ -7,6 +7,7 @@ class Orders_entity{
|
||||
|
||||
const SRV_MCH_ID = '1612636924'; //收取服务费商户号 厦门狸车服务
|
||||
const PRICE_FINANCE = 1000; //金融服务费写死
|
||||
const PRICE_FINANCE_NZ = 2000; //哪吒金融服务费
|
||||
|
||||
private $ci;
|
||||
private $order_row;
|
||||
@@ -334,10 +335,9 @@ class Orders_entity{
|
||||
$this->order_row = $this->ci->orders_model->get(['id'=>$oid]);
|
||||
}
|
||||
$money_json = json_decode($this->order_row['money_json'],true);
|
||||
$packs = $this->ci->package_model->get(['id'=>$this->order_row['pack_id']],'srv_ids');
|
||||
$services = [];
|
||||
if($packs['srv_ids']){
|
||||
$services = $this->ci->services_model->select(["id in ({$packs['srv_ids']})"=>null],'','','','title,field_name');
|
||||
if($this->order_row['srv_ids']){
|
||||
$services = $this->ci->services_model->select(["id in ({$this->order_row['srv_ids']})"=>null],'','','','title,field_name');
|
||||
}
|
||||
$srv_price = 0;
|
||||
$list = [];//明细
|
||||
@@ -381,6 +381,7 @@ class Orders_entity{
|
||||
|
||||
$srv_money = $this->order_srv_money($oid); //服务费
|
||||
$money_json = json_decode($this->order_row['money_json'],true);
|
||||
$money_json['price_discount'] && $money_json['price_car'] = $money_json['price_car'] - $money_json['price_discount'];
|
||||
if($this->order_row['payway']){ //全款
|
||||
if($srv_money < $this->order_row['deposit']){ //服务费小于定金
|
||||
$to_srv_price = $srv_money;
|
||||
@@ -530,7 +531,7 @@ class Orders_entity{
|
||||
public function edit_order($new_data,$row,$uid,$uname){
|
||||
$sign_row = $this->ci->signs_model->get(['o_id'=>$row['id']]);
|
||||
if($sign_row){
|
||||
$diff_key_arr = ['s_id','v_id','cor_id','incor_id','payway','pack_id']; //修改其中一项需要签补充协议
|
||||
$diff_key_arr = ['s_id','v_id','cor_id','incor_id','payway','srv_ids']; //修改其中一项需要签补充协议
|
||||
$need_resign = false;
|
||||
foreach($diff_key_arr as $item){
|
||||
if($new_data[$item]!=$row[$item]){
|
||||
@@ -538,6 +539,12 @@ class Orders_entity{
|
||||
break;
|
||||
}
|
||||
}
|
||||
//修改优惠金额
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$new_money_json = json_decode($new_data['money_json'],true);
|
||||
if($money_json['price_discount']!=$new_money_json['price_discount']){
|
||||
$need_resign = true;
|
||||
}
|
||||
if($new_data['payway']!=$row['payway']){ //修改付款方式
|
||||
$this->ci->load->model('receiver/order/receiver_order_loans_model');
|
||||
$this->ci->receiver_order_loans_model->delete(['o_id'=>$row['id']]);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Vim
|
||||
* User: lcc
|
||||
* Date: 2021/10/29
|
||||
* Time: 15:47
|
||||
*/
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Receiver_fine_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_fine';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
-- ----------------------------
|
||||
-- Title:订单精品
|
||||
-- Author:lcc
|
||||
-- Table:lc_receiver_fine
|
||||
-- ---------------------------
|
||||
create table lc_receiver_fine (
|
||||
id int(10) not null auto_increment comment '自增id',
|
||||
title varchar(50) not null default '' comment '标题',
|
||||
price decimal(10,2) not null default '0.00' comment '价格',
|
||||
status tinyint(1) not null default '0' comment '状态(1开启 0关闭 -1删除)',
|
||||
u_time timestamp not null default current_timestamp on update current_timestamp comment '更新时间',
|
||||
c_time int(10) not null default '0' comment '创建时间',
|
||||
primary key (id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment='订单精品'
|
||||
@@ -157,7 +157,7 @@ create table lc_receiver_order_signs (
|
||||
-- Author:lcc
|
||||
-- Table:lc_receiver_orders
|
||||
-- info_json entrust_name 代办人姓名 entrust_idcard 代办人身份证 name 姓名 sex 性别 nation 民族 birth 出生日期 address 家庭地址 cardid 身份证 c_address 创建时输入的地址 c_cardid 创建时输入的身份证
|
||||
-- money_json price_car 裸车价 price_book 定金 price_insure 保险价格 price_fine 精品报价 price_finance 金融报价 price_loan贷款金额
|
||||
-- money_json price_car 裸车价 price_book 定金 price_insure 保险价格 price_fine 精品报价 price_finance 金融报价 price_loan贷款金额 price_discount优惠金额
|
||||
-- ---------------------------
|
||||
drop table if exists lc_receiver_orders;
|
||||
create table lc_receiver_orders (
|
||||
@@ -191,4 +191,6 @@ alter table lc_receiver_orders add main_type tinyint(1) unsigned not null defaul
|
||||
alter table lc_receiver_orders add ifentrust tinyint(1) unsigned not null default 0 comment '是否委托代办' after main_type;
|
||||
alter table lc_receiver_orders add delry_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '期望交付时间' after status;
|
||||
alter table lc_receiver_orders add finance_id int(10) unsigned not null default 0 comment '车型金融信息id' after payway;
|
||||
alter table lc_receiver_orders add money_json json default null comment "格json数据" after info_json;
|
||||
alter table lc_receiver_orders add money_json json default null comment "价格json数据" after info_json;
|
||||
alter table lc_receiver_orders add srv_ids varchar(100) not null default '' comment '服务id多个逗号隔开' after pack_id;
|
||||
alter table lc_receiver_orders add fine_ids varchar(100) not null default '' comment '精品id多个逗号隔开' after srv_ids;
|
||||
|
||||
Reference in New Issue
Block a user