edit-api-create_order
This commit is contained in:
@@ -96,6 +96,7 @@ class Cars extends HD_Controller{
|
||||
'price_book' => $v['price_book'] > 0 ? $v['price_book'] : '0.00',
|
||||
'price_insure' => $v['price_insure'] > 0 ? $v['price_insure'] : '0.00',
|
||||
'price_fine' => $v['price_fine'] > 0 ? $v['price_fine'] : '0.00',
|
||||
'price_fine_floor' => $v['price_fine_floor'] > 0 ? $v['price_fine_floor'] : '0.00',
|
||||
'price_finance' => $v['price_finance'] > 0 ? $v['price_finance'] : '0.00',
|
||||
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
|
||||
'brokerage_1' => $v['brokerage_1'] > 0 ? $v['brokerage_1'] : '0.00',
|
||||
@@ -263,6 +264,7 @@ class Cars extends HD_Controller{
|
||||
'price_book' => floatval($info['price_book']),
|
||||
'price_insure' => floatval($info['price_insure']),
|
||||
'price_fine' => floatval($info['price_fine']),
|
||||
'price_fine_floor' => floatval($info['price_fine_floor']),
|
||||
'price_finance' => floatval($info['price_finance']),
|
||||
'price_coplus' => floatval($info['price_coplus']),
|
||||
'brokerage_1' => floatval($info['brokerage_1']),
|
||||
|
||||
@@ -155,6 +155,7 @@ class Orders extends HD_Controller
|
||||
$d = $srv_detail ? ',' : '';
|
||||
$srv_detail .= $d . $val['title'] . ":" . number_format($val['money'], 2);
|
||||
}
|
||||
$money_json['price_fine_discount']>0 && $srv_detail.=',精品尊享包优惠:'.$money_json['price_fine_discount'];
|
||||
}
|
||||
$srv_info['detail'] = $srv_detail;
|
||||
$row['srv_info'] = $srv_info;
|
||||
|
||||
@@ -34,6 +34,13 @@
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50 fl">
|
||||
<label class="am-para-label">精品最低价:</label>
|
||||
<div class="am-para-input">
|
||||
<input type="text" placeholder="请输入精品最低价" name="price_fine_floor" v-model="info.price_fine_floor" style="display: inline;width: 60%"/>
|
||||
<span>元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50 fl">
|
||||
<label class="am-para-label">金融报价:</label>
|
||||
<div class="am-para-input">
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<th width="7%"><span>定金</span></th>
|
||||
<th width="7%"><span>保险报价</span></th>
|
||||
<th width="7%"><span>精品报价</span></th>
|
||||
<th width="7%"><span>精品最低价</span></th>
|
||||
<th width="7%"><span>金融报价</span></th>
|
||||
<th width="7%"><span>公司加价</span></th>
|
||||
<th width="9%"><span>一级分销佣金</span></th>
|
||||
@@ -64,7 +65,7 @@
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr class="tl">
|
||||
<td colspan="11">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
<td colspan="12">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>
|
||||
@@ -77,6 +78,7 @@
|
||||
<td><input style="width: 100%" type="text" name="price_book" v-model="info_edit.price_book" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_insure" v-model="info_edit.price_insure" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_fine" v-model="info_edit.price_fine" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_fine_floor" v-model="info_edit.price_fine_floor" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_finance" v-model="info_edit.price_finance" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="price_coplus" v-model="info_edit.price_coplus" placeholder=""></td>
|
||||
<td><input style="width: 100%" type="text" name="brokerage_1" v-model="info_edit.brokerage_1" placeholder=""></td>
|
||||
@@ -88,6 +90,7 @@
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_book}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_insure}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_fine}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_fine_floor}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_finance}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.price_coplus}}</td>
|
||||
<td @dblclick="set_edit(i,1)">{{v.brokerage_1}}</td>
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
</div>
|
||||
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<div class="am-form-group am-u-lg-12">
|
||||
<label class="am-para-label label-width"><span class="span-bold">合同信息:</span></label>
|
||||
<div class="am-form am-form-inline" v-if="info.contract_data">
|
||||
<div class="am-form-group" v-if="info.contract_data[0]">
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="am-form-inline">
|
||||
<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">
|
||||
<div class="am-para-input" style="margin-left:120px">
|
||||
<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>
|
||||
|
||||
@@ -181,23 +181,31 @@ class Xzcall extends HD_Controller
|
||||
|
||||
//更新订单服务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' => ''
|
||||
"srv_ids like '%3%'" => null
|
||||
];
|
||||
$rows = $this->orders_model->select($where,'id asc',$page,$size);
|
||||
$rows = $this->orders_model->select($where,'id asc',$page,$size,'id,srv_ids,jsondata');
|
||||
if($rows){
|
||||
foreach($rows as $item){
|
||||
$pack = $this->package_model->get(['id'=>$item['pack_id']]);
|
||||
$res = false;
|
||||
if($pack){
|
||||
$srv_ids_arr = explode(',',$item['srv_ids']);
|
||||
if(in_array(3,$srv_ids_arr)){
|
||||
$jsondata = json_decode($item['jsondata'],true);
|
||||
$jsondata['old_srv_ids'] = $item['srv_ids'];
|
||||
$jsondata['if_fine'] = 1;
|
||||
foreach($srv_ids_arr as $key=>$val){
|
||||
if($val==3){
|
||||
unset($srv_ids_arr[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$updata = [
|
||||
'srv_ids' => $pack['srv_ids']
|
||||
'jsondata' => json_encode($jsondata,JSON_UNESCAPED_UNICODE),
|
||||
'srv_ids' => implode(',',$srv_ids_arr)
|
||||
];
|
||||
$res = $this->orders_model->update($updata,['id'=>$item['id']]);
|
||||
}
|
||||
|
||||
@@ -195,10 +195,13 @@ class Series extends Wxapp{
|
||||
if(!$car){
|
||||
throw new Exception('当前车型暂无库存', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$dis_fine_money = $car['price_fine_floor']>0 && $car['price_fine']-$car['price_fine_floor']>0 ? $car['price_fine']-$car['price_fine_floor'] : 0;
|
||||
$data = [
|
||||
'price' => $car['price_car'] ? $car['price_car'] : 0,
|
||||
'deposit' => $car['price_book'] ? $car['price_book'] : 0,
|
||||
'dis_money' => $car['price_car'] - $car['price_floor']
|
||||
'price' => $car['price_car'] ? floatval($car['price_car']) : 0,
|
||||
'deposit' => $car['price_book'] ? floatval($car['price_book']) : 0,
|
||||
'dis_money' => $car['price_car'] - $car['price_floor'],
|
||||
'fine_money' => floatval($car['price_fine']),
|
||||
'dis_fine_money' => $dis_fine_money,
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ class Cusorder extends Wxapp{
|
||||
$finance_id = $this->input_param('finance_id');
|
||||
$inten_money = floatval($this->input_param('inten_money'));//意向金
|
||||
$disc_money = floatval($this->input_param('disc_money'));//优惠金额
|
||||
$disc_fine_money = floatval($this->input_param('disc_fine_money'));//精品优惠金额
|
||||
$if_fine = $this->input_param('if_fine');
|
||||
$srv_ids = $this->input_param('srv_ids');
|
||||
$fine_ids = $this->input_param('fine_ids');
|
||||
|
||||
@@ -123,7 +125,7 @@ class Cusorder extends Wxapp{
|
||||
}else{
|
||||
if($disc_money) throw new Exception('当前车型没有优惠额度', API_CODE_FAIL);
|
||||
}
|
||||
$total_dis_money = $disc_money; //总优惠金额包含精品
|
||||
$total_dis_money = $disc_money; //总优惠金额包含赠送精品
|
||||
if(!$payway){ //分期
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$finance_id,'status'=>1]);
|
||||
if(!$finance_row){
|
||||
@@ -185,6 +187,9 @@ class Cusorder extends Wxapp{
|
||||
$cardid && $info_json['c_cardid'] = $cardid;
|
||||
$address && $info_json['c_address'] = $address;
|
||||
$info_json && $data['info_json'] = json_encode($info_json,JSON_UNESCAPED_UNICODE);
|
||||
$jsondata = [];
|
||||
$jsondata['if_fine'] = $if_fine ? 1 : 0;
|
||||
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
$finance_row && $data['finance_id'] = $finance_row['id'];
|
||||
//获取金额json数据
|
||||
$orders_entity = new Orders_entity();
|
||||
@@ -195,7 +200,8 @@ class Cusorder extends Wxapp{
|
||||
'price_fine' => $car_row['price_fine'],
|
||||
'price_discount' =>$disc_money ? $disc_money : 0,
|
||||
'price_intention' => $inten_money ? $inten_money : 0,
|
||||
'price_finance' => $series_row['brand_id'] == 4 ? $orders_entity::PRICE_FINANCE_NZ : $orders_entity::PRICE_FINANCE
|
||||
'price_finance' => $series_row['brand_id'] == 4 ? $orders_entity::PRICE_FINANCE_NZ : $orders_entity::PRICE_FINANCE,
|
||||
'price_fine_discount' => $disc_fine_money ? $disc_fine_money : 0
|
||||
];
|
||||
//获取挂牌价
|
||||
if($series_row['brand_id']==3){ //狸车品牌写死挂牌费用0.01 测试用
|
||||
@@ -374,9 +380,11 @@ class Cusorder extends Wxapp{
|
||||
if(!$row){
|
||||
throw new Exception('订单不存在', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$orders_entity = new Orders_entity();
|
||||
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$info_json = json_decode($row['info_json'],true);
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
|
||||
$brand = $this->auto_brand_model->get(['id'=>$row['brand_id']],'name');
|
||||
$series = $this->auto_series_model->get(['id'=>$row['s_id']],'name');
|
||||
@@ -404,7 +412,9 @@ class Cusorder extends Wxapp{
|
||||
$pack_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'));
|
||||
$srv_title_arr = array_column($srv_rows,'title');
|
||||
$jsondata['if_fine'] && $srv_title_arr[] = '精品尊享包';
|
||||
$srv_rows && $pack_title = implode('+',$srv_title_arr);
|
||||
}
|
||||
$car_data = [];
|
||||
if($row['brand_id'] && $row['s_id'] && $row['v_id']){
|
||||
@@ -412,20 +422,30 @@ class Cusorder extends Wxapp{
|
||||
$car_data['车辆名称'] = $brand['name'].$series['name'];
|
||||
$car_data['车辆级别'] = $version;
|
||||
$car_data['颜色'] = $color;
|
||||
$car_data['车辆合同售价'] = $money_json['price_discount'] ? $row['price']-$money_json['price_discount'] : $row['price'];
|
||||
$car_data['车辆平台售价'] = $money_json['price_discount'] ? $row['price']-$money_json['price_discount'] : $row['price'];
|
||||
$money_json['price_discount'] && $car_data['优惠金额'] = $money_json['price_discount'];
|
||||
$car_data['定金'] = $row['deposit'];
|
||||
$car_data['代办包'] = $pack_title;
|
||||
$car_data['购车主体'] = $row['main_type'] ? '公司' : '个人';
|
||||
$car_data['是否委托'] = $row['ifentrust'] ? '是' : '否';
|
||||
//服务费
|
||||
$srv_data = $orders_entity->order_srv_money($row['id'],1);
|
||||
if($srv_data['total']>0){
|
||||
$car_data['代办费']['value'] = sprintf('%.2f',$srv_data['total']);
|
||||
foreach($srv_data['list'] as $val){
|
||||
$car_data['代办费']['list'][$val['title']] = sprintf('%.2f',$val['money']);
|
||||
}
|
||||
}
|
||||
if($row['ifentrust']){
|
||||
$car_data['是否委托'] = '是';
|
||||
$car_data['委托人姓名'] = $info_json['entrust_name'] ? $info_json['entrust_name'] : '';
|
||||
$car_data['委托人手机号'] = $info_json['entrust_mobile'] ? $info_json['entrust_mobile'] : '';
|
||||
$car_data['委托人身份证'] = $info_json['entrust_idcard'] ? $info_json['entrust_idcard'] : '';
|
||||
}
|
||||
if($row['ifentrust'] && $row['main_type']){
|
||||
$car_data['购车主体'] = '公司';
|
||||
}
|
||||
}
|
||||
$info_json['c_address'] && $car_data['地址'] = $info_json['c_address'];
|
||||
$info_json['c_cardid'] && $car_data['身份证号'] = $info_json['c_cardid'];
|
||||
$info_json['c_address'] && $car_data['地址'] = $info_json['c_address'];
|
||||
if(!$row['payway']){
|
||||
$finance_row = $this->sys_finance_model->get(['id'=>$row['finance_id']],'title');
|
||||
$car_data['金融产品'] = $finance_row['title'];
|
||||
@@ -468,7 +488,6 @@ class Cusorder extends Wxapp{
|
||||
if($row['status']==5&&in_array($delivery['status'],[0,1])){
|
||||
$ckcar_status = 1;
|
||||
}
|
||||
$orders_entity = new Orders_entity();
|
||||
$data = [
|
||||
'id' => $id,
|
||||
'name' => $row['name'],
|
||||
@@ -502,6 +521,8 @@ class Cusorder extends Wxapp{
|
||||
'edit_status' => $row['status'] > 2 ? 0 : 1,
|
||||
'status' => $row['status'],
|
||||
'my_img' => $orders_entity::API_CREATE_PAY_IMG,
|
||||
'if_fine' => $jsondata['if_fine'] ? 1 : 0,
|
||||
'disc_fine_money' => $money_json['price_fine_discount'] ? $money_json['price_fine_discount'] : 0
|
||||
];
|
||||
$inten_money && $data['inten_money'] = $inten_money;
|
||||
return $data;
|
||||
|
||||
@@ -133,6 +133,8 @@ class Cusorder2 extends Wxapp{
|
||||
$delry_time = $this->input_param('delry_time');
|
||||
$finance_id = $this->input_param('finance_id');
|
||||
$disc_money = floatval($this->input_param('disc_money'));//优惠金额
|
||||
$disc_fine_money = floatval($this->input_param('disc_fine_money'));//精品优惠金额
|
||||
$if_fine = $this->input_param('if_fine');
|
||||
$srv_ids = $this->input_param('srv_ids');
|
||||
$fine_ids = $this->input_param('fine_ids');
|
||||
|
||||
@@ -222,10 +224,15 @@ class Cusorder2 extends Wxapp{
|
||||
$money_json['price_insure'] = $car_row['price_insure'];
|
||||
$money_json['price_fine'] = $car_row['price_fine'];
|
||||
$money_json['price_discount'] = $disc_money;
|
||||
$money_json['price_fine_discount'] = $disc_fine_money;
|
||||
$orders_entity = new Orders_entity();
|
||||
$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);
|
||||
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$jsondata['if_fine'] = $if_fine ? 1 : 0;
|
||||
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$result = $this->orders_model->update($data,['id'=>$row['id']]);
|
||||
if($result){
|
||||
$orders_entity->edit_order($data,$row,$this->session['uid'],$this->session['uname']);
|
||||
|
||||
@@ -97,6 +97,7 @@ class Protocol extends CI_Controller{
|
||||
$services = [];
|
||||
if($row){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
//获取门店信息
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
|
||||
if($biz['srv_company_id']){
|
||||
@@ -104,7 +105,6 @@ class Protocol extends CI_Controller{
|
||||
}else{
|
||||
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
|
||||
}
|
||||
$is_insure = false;
|
||||
if($row['srv_ids']){
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$service_rows = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','id,title,field_name');
|
||||
@@ -120,12 +120,18 @@ class Protocol extends CI_Controller{
|
||||
}
|
||||
|
||||
$srv_id_arr = explode(',',$row['srv_ids']);
|
||||
$is_insure = in_array(1,$srv_id_arr) ? true : false;
|
||||
}
|
||||
if($jsondata['if_fine']){ //选择精品包
|
||||
$fine_price = $money_json['price_fine_discount'] ? $money_json['price_fine'] - $money_json['price_fine_discount'] : $money_json['price_fine'];
|
||||
$services[] = [
|
||||
'id' => '',
|
||||
'title' => '精品尊享包',
|
||||
'money' => $fine_price
|
||||
];
|
||||
}
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$srv_price = $this->orders_entity->order_srv_money($row['id']);
|
||||
}
|
||||
$row['is_insure'] = $is_insure;
|
||||
$row['services'] = $services;
|
||||
$row['srv_price'] = $srv_price;
|
||||
$row['info_json'] = json_decode($row['info_json'],true);
|
||||
@@ -328,7 +334,9 @@ 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);
|
||||
$old_jsondata = json_decode($opt_row['jsondata'],true);
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
//获取门店信息
|
||||
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
|
||||
if($biz['srv_company_id']){
|
||||
@@ -338,12 +346,16 @@ class Protocol extends CI_Controller{
|
||||
}
|
||||
if($row['srv_ids']){
|
||||
$service_rows = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','title');
|
||||
$services = implode(',',array_column($service_rows,'title'));
|
||||
$service_array = array_column($service_rows,'title');
|
||||
}
|
||||
$jsondata['if_fine'] && $service_array[]='精品尊享包';
|
||||
$services = implode(',',$service_array);
|
||||
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'));
|
||||
$old_service_array = array_column($service_rows,'title');
|
||||
}
|
||||
$old_jsondata['if_fine'] && $old_service_array[]='精品尊享包';
|
||||
$old_services = implode(',',$old_service_array);
|
||||
$this->load->library('receiver/orders_entity');
|
||||
$srv_price = $this->orders_entity->order_srv_money($row['id']);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,9 @@ class Services extends Wxapp{
|
||||
$order_row = $this->orders_model->get(['id'=>$id]);
|
||||
$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],'price_insure,price_fine');
|
||||
$where = [];
|
||||
$where = [
|
||||
'id!=' => 3
|
||||
];
|
||||
$payway && $where['id !='] = 4; //全款不显示金融
|
||||
$count = $this->services_model->count($where);
|
||||
$list = [];
|
||||
@@ -65,7 +67,7 @@ class Services extends Wxapp{
|
||||
$list[] = [
|
||||
'id' => $val['id'],
|
||||
'title' => $val['title'],
|
||||
'price' => $price_arr[$field_arr[1]] ? $price_arr[$field_arr[1]] : 0
|
||||
'price' => $price_arr[$field_arr[1]] && $field_arr[1]!='price_insure' ? $price_arr[$field_arr[1]] : 0
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class Progressopt{
|
||||
'brand_id>' => 0,
|
||||
"(mobile='{$mobile}' or (ifentrust=1 and json_extract(info_json,'$.entrust_mobile')='{$mobile}'))" => null
|
||||
];
|
||||
$rows = $this->ci->orders_model->select($where,'id asc','','','id,name,payway,money_json,status,s_id,v_id,cor_id,incor_id,srv_ids');
|
||||
$rows = $this->ci->orders_model->select($where,'id asc','','','id,name,payway,money_json,status,s_id,v_id,cor_id,incor_id,srv_ids,jsondata');
|
||||
$progress_list = [];
|
||||
if($rows){
|
||||
foreach($rows as $order){
|
||||
@@ -105,7 +105,9 @@ class Progressopt{
|
||||
$opt_row = $this->ci->receiver_order_oplogs_model->select(['order_id'=>$order['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_jsondata = json_decode($opt_row['jsondata'],true);
|
||||
$money_json = json_decode($order['money_json'],true);
|
||||
$jsondata = json_decode($order['jsondata'],true);
|
||||
$progressOpt = [];
|
||||
foreach($progress_arr as $item){
|
||||
$imgs = [];
|
||||
@@ -129,6 +131,18 @@ class Progressopt{
|
||||
if($opt_row['srv_ids']!=$order['srv_ids']){
|
||||
$need_resign_agent = true; //需要签服务补充协议
|
||||
}
|
||||
//修改精品
|
||||
if($jsondata['if_fine']!=$opt_jsondata['if_fine']){
|
||||
$need_resign_agent = true; //需要签服务补充协议
|
||||
}
|
||||
if($jsondata['if_fine'] && $opt_jsondata['if_fine']){
|
||||
$price_fine = $money_json['price_fine_discount'] ? $money_json['fine_price'] - $money_json['price_fine_discount'] : $money_json['fine_price'];
|
||||
$opt_price_fine = $opt_money_json['price_fine_discount'] ? $opt_money_json['fine_price'] - $opt_money_json['price_fine_discount'] : $opt_money_json['fine_price'];
|
||||
if($price_fine!=$opt_price_fine){
|
||||
$need_resign_agent = true; //需要签服务补充协议
|
||||
}
|
||||
}
|
||||
|
||||
if($need_resign_car && !$car_count){
|
||||
$url = '/pages/mine/signContract/maiMaiBu?id='.$order['id'];
|
||||
}elseif($need_resign_agent && !$agent_count){
|
||||
|
||||
@@ -357,6 +357,19 @@ class Orders_entity{
|
||||
}
|
||||
}
|
||||
}
|
||||
$jsondata = json_decode($this->order_row['jsondata'],true);
|
||||
if($jsondata['if_fine']){ //选择精品包
|
||||
$fine_price = $money_json['price_fine'];
|
||||
if($money_json['price_fine_discount']){ //优惠精品价格
|
||||
$fine_price = $fine_price - $money_json['price_fine_discount'];
|
||||
}
|
||||
$srv_price += $fine_price;
|
||||
|
||||
$list[] = [
|
||||
'title' => '精品尊享包',
|
||||
'money' => $fine_price
|
||||
];
|
||||
}
|
||||
$result['total'] = $srv_price;
|
||||
$result['list'] = $list;
|
||||
return $res_type ? $result:$srv_price;
|
||||
@@ -549,9 +562,22 @@ class Orders_entity{
|
||||
//修改优惠金额
|
||||
$money_json = json_decode($row['money_json'],true);
|
||||
$new_money_json = json_decode($new_data['money_json'],true);
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$new_jsondata = json_decode($new_data['jsondata'],true);
|
||||
if($money_json['price_discount']!=$new_money_json['price_discount']){
|
||||
$need_resign = true;
|
||||
}
|
||||
//修改精品
|
||||
if($jsondata['if_fine']!=$new_jsondata['if_fine']){
|
||||
$need_resign = true;
|
||||
}
|
||||
if($jsondata['if_fine'] && $new_jsondata['if_fine']){
|
||||
$price_fine = $money_json['price_fine_discount'] ? $money_json['fine_price'] - $money_json['price_fine_discount'] : $money_json['fine_price'];
|
||||
$new_price_fine = $new_money_json['price_fine_discount'] ? $new_money_json['fine_price'] - $new_money_json['price_fine_discount'] : $new_money_json['fine_price'];
|
||||
if($price_fine!=$new_price_fine){
|
||||
$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']]);
|
||||
@@ -560,18 +586,19 @@ class Orders_entity{
|
||||
$content = '修改订单信息';
|
||||
$jsondata = json_encode($row,JSON_UNESCAPED_UNICODE);
|
||||
$this->add_log($row['id'],$uid,$uname,$content,3,'wxapp',$jsondata); //添加日志
|
||||
$this->ci->receiver_order_contracts_model->delete(['o_id'=>$row['id'],'type in (4,5)'=>null]);
|
||||
if(!$row['status']){ //未签合同删除旧合同文件并且删除未支付订单
|
||||
$this->ci->load->model('app/liche/app_liche_users_model');
|
||||
$this->ci->receiver_order_contracts_model->delete(['o_id'=>$row['id']]);
|
||||
$userinfo = $this->ci->app_liche_users_model->get(['mobile'=>$row['mobile']]);
|
||||
$this->ci->app_liche_orders_model->delete(['o_id'=>$row['id'],'status'=>0,'pid!='=>0]);
|
||||
}
|
||||
$this->ci->receiver_order_contracts_model->delete(['o_id'=>$row['id'],'type in (4,5)'=>null]); //删除补充合同
|
||||
$this->ci->signs_model->update(['status'=>0],['id'=>$sign_row['id']]);
|
||||
$this->ci->orders_model->update(['status'=>0],['id'=>$row['id']]);
|
||||
}
|
||||
}else{
|
||||
$this->ci->signs_model->add(['o_id'=>$row['id'],'c_time'=>time()]);
|
||||
if($sign_row){ //未签合同删除旧合同文件并且删除未支付订单
|
||||
$this->ci->load->model('app/liche/app_liche_users_model');
|
||||
$this->ci->receiver_order_contracts_model->delete(['o_id'=>$row['id']]);
|
||||
$userinfo = $this->ci->app_liche_users_model->get(['mobile'=>$row['mobile']]);
|
||||
$this->ci->app_liche_orders_model->delete(['o_id'=>$row['id'],'status'=>0,'pid!='=>0]);
|
||||
}else{
|
||||
$this->ci->signs_model->add(['o_id'=>$row['id'],'c_time'=>time()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -159,8 +159,9 @@ create table lc_receiver_order_signs (
|
||||
-- Title:订单表
|
||||
-- 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贷款金额 price_discount优惠金额 price_intention意向金
|
||||
--- jsondata if_fine 是否选择精品尊享包
|
||||
-- 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贷款金额 price_discount优惠金额 price_intention意向金 price_fine_discount精品优惠金额
|
||||
-- ---------------------------
|
||||
drop table if exists lc_receiver_orders;
|
||||
create table lc_receiver_orders (
|
||||
|
||||
Reference in New Issue
Block a user