From b3440fac6f9e415e58fcb46f49470bd2474a4c1a Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 8 Jun 2023 17:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=BF=9D=E9=99=A9=E8=BF=94=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/wxapp/licheb/Cusorderdata.php | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/api/controllers/wxapp/licheb/Cusorderdata.php b/api/controllers/wxapp/licheb/Cusorderdata.php index 99f6022e..b0dd3662 100644 --- a/api/controllers/wxapp/licheb/Cusorderdata.php +++ b/api/controllers/wxapp/licheb/Cusorderdata.php @@ -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); } }