加保险返点

This commit is contained in:
dengbw
2023-06-08 17:03:04 +08:00
parent 99b743c34d
commit f160297b22
+16 -8
View File
@@ -55,6 +55,7 @@ class Cusorderdata extends Wxapp{
'img' => build_qiniu_image_url($d_ins_info['img']),
'product' => $d_ins_info['product'] ? $d_ins_info['product'] : '',
'price' => $d_ins_info['price'] ? $d_ins_info['price'] : 0,
'rebate' => $d_ins_info['rebate'] ? $d_ins_info['rebate'] : 0,
'date' => $d_ins_info['date'] ? $d_ins_info['date'] : '',
];
}
@@ -65,17 +66,19 @@ class Cusorderdata extends Wxapp{
'img' => build_qiniu_image_url($d_ins_img['img']),
'product' => $d_ins_img['product'] ? $d_ins_img['product'] : '',
'price' => $d_ins_img['price'] ? $d_ins_img['price'] : 0,
'rebate' => $d_ins_img['rebate'] ? $d_ins_img['rebate'] : 0,
'date' => $d_ins_img['date'] ? $d_ins_img['date'] : '',
];
}
$d_accident_info = json_decode($row_data['accident_img'],true);
if($d_accident_info){
$d_accident_img = json_decode($row_data['accident_img'],true);
if($d_accident_img){
$accident_img = [
'value' => $d_accident_info['img'],
'img' => build_qiniu_image_url($d_accident_info['img']),
'product' => $d_accident_info['product'] ? $d_accident_info['product'] : '',
'price' => $d_accident_info['price'] ? $d_accident_info['price'] : 0,
'date' => $d_accident_info['date'] ? $d_accident_info['date'] : '',
'value' => $d_accident_img['img'],
'img' => build_qiniu_image_url($d_accident_img['img']),
'product' => $d_accident_img['product'] ? $d_accident_img['product'] : '',
'price' => $d_accident_img['price'] ? $d_accident_img['price'] : 0,
'rebate' => $d_accident_img['rebate'] ? $d_accident_img['rebate'] : 0,
'date' => $d_accident_img['date'] ? $d_accident_img['date'] : '',
];
}
$bill_img_json = json_decode($row_data['bill_ck_img'],true);
@@ -339,20 +342,24 @@ class Cusorderdata extends Wxapp{
$product = $this->input_param('product');
$price = $this->input_param('price');
$date = $this->input_param('date');
$rebate = $this->input_param('rebate');//保险返点
$data_row = $this->receiver_order_datas_model->get(['o_id'=>$id]);
if(!$data_row){
throw new Exception('数据不存在', ERR_PARAMS_ERROR);
}
!$rebate && $rebate = 0;
if($type==1){ //交强险图片
$jsondata = json_decode($data_row['insurance_img'],true);
$jsondata['product'] = $product;
$jsondata['price'] = $price;
$jsondata['rebate'] = $rebate;
$jsondata['date'] = $date;
$update['insurance_img'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
}elseif($type==2){ //意外险图片
$jsondata = json_decode($data_row['accident_img'],true);
$jsondata['product'] = $product;
$jsondata['price'] = $price;
$jsondata['rebate'] = $rebate;
$jsondata['date'] = $date;
$update['accident_img'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
}else{ //商业险图片
@@ -362,10 +369,11 @@ class Cusorderdata extends Wxapp{
$jsondata = json_decode($data_row['business_img'],true);
$jsondata['product'] = $product;
$jsondata['price'] = $price;
$jsondata['rebate'] = $rebate;
$jsondata['date'] = $date;
$update['business_img'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
}
$res = $this->receiver_order_datas_model->update($update,['id'=>$data_row['id']]);
$this->receiver_order_datas_model->update($update,['id'=>$data_row['id']]);
throw new Exception('修改成功', API_CODE_SUCCESS);
}
}