From 4ecd61506e18d04a5a99aef60cea6a9713f4acb6 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Tue, 7 Feb 2023 16:03:45 +0800 Subject: [PATCH] add-admin-accident_ins --- admin/controllers/receiver/orderv2/Orders.php | 27 ++++++++++++++++--- admin/views/receiver/orderv2/get/ckinfo.php | 24 ++++++++++++----- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index 1ef8ea5b..4ee5a6c0 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -445,6 +445,7 @@ class Orders extends HD_Controller } //获取审核资料信息 $img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id'],'status>='=>0]); + $img_data_jsondata = json_decode($img_data['jsondata'],true); $row['imgs_status'] = $this->order_datas_entity->data_ckinfo($img_data,$row['main_type']); //获取开票 $bill_ck_img = json_decode($img_data['bill_ck_img'],true); @@ -516,6 +517,8 @@ class Orders extends HD_Controller $agent['business_price'] = $business_img['price'] ? $business_img['price'] : ''; $agent['business_product'] = $business_img['product'] ? $business_img['product'] : ''; $agent['car_num'] = $agent['car_num'] ? $agent['car_num'] : ''; + $agent['accident_price'] = $img_data_jsondata['accident_price'] ? $img_data_jsondata['accident_price'] : ''; + $agent['accident_title'] = $img_data_jsondata['accident_title'] ? $img_data_jsondata['accident_title'] : ''; if(!$agent['ins_time'] && $business_img){ $img_jsondata = json_decode($img_data['jsondata'],true); $business_img_key = md5(build_qiniu_image_url($business_img['img'])); @@ -1191,7 +1194,7 @@ class Orders extends HD_Controller public function edit_imgs(){ $id = $this->input->post('id'); $field = $this->input->post('filed'); - $value = $this->input->post('value'); + $save_value = $value = $this->input->post('value'); $row = $this->receiver_orders_v2_model->get(['id'=>$id]); if(!$row){ return $this->show_json(SYS_CODE_FAIL, '参数错误'); @@ -1205,10 +1208,10 @@ class Orders extends HD_Controller if($field=='ins_img' || $field=='other_img'){ $val_arr = json_decode($re_data[$field],true); $val_arr[] = $value; - $value = json_encode($val_arr,JSON_UNESCAPED_UNICODE); + $save_value = json_encode($val_arr,JSON_UNESCAPED_UNICODE); } $update = [ - $field => $value + $field => $save_value ]; if($field=='insurance_img'||$field=='business_img'){ $jsondata = json_decode($re_data['jsondata'],true); @@ -1244,6 +1247,18 @@ class Orders extends HD_Controller $jsondata['car_info'] = $result['data']['FrontInfo']; $update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE); } + //识别其它保单 + if($field=='ins_img'){ + $jsondata = json_decode($re_data['jsondata'],true); + $img_url = build_qiniu_image_url($value); + $result = $this->tcmarket->autoInsurance($img_url); + if ($result['code']) { + $jsondata['ins_info'][md5($img_url)] = $result; + $jsondata['accident_price'] = $result['data']['premium']; + $jsondata['accident_title'] = $result['data']['companyName']; + $update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE); + } + } $res = $this->receiver_order_datas_model->update($update,['id'=>$re_data_id]); if($res){ if($field=='car_img'){//更新车牌号 @@ -1312,15 +1327,19 @@ class Orders extends HD_Controller } if ($result) { $img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id']]); + $img_data_jsondata = json_decode($img_data['jsondata'],true); $insurance_img = json_decode($img_data['insurance_img'],true); $business_img = json_decode($img_data['business_img'],true); $insurance_img['product'] = $params['insurance_product']; $insurance_img['price'] = $params['insurance_price']; $business_img['product'] = $params['business_product']; $business_img['price'] = $params['business_price']; + $img_data_jsondata['accident_title'] = $params['accident_title']; + $img_data_jsondata['accident_price'] = $params['accident_price']; $up_data = [ 'insurance_img' => json_encode($insurance_img,JSON_UNESCAPED_UNICODE), - 'business_img' => json_encode($business_img,JSON_UNESCAPED_UNICODE) + 'business_img' => json_encode($business_img,JSON_UNESCAPED_UNICODE), + 'jsondata' => json_encode($img_data_jsondata,JSON_UNESCAPED_UNICODE) ]; $this->receiver_order_datas_model->update($up_data,['o_id'=>$row['id']]); return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); diff --git a/admin/views/receiver/orderv2/get/ckinfo.php b/admin/views/receiver/orderv2/get/ckinfo.php index 96ab9888..bdeecc8b 100644 --- a/admin/views/receiver/orderv2/get/ckinfo.php +++ b/admin/views/receiver/orderv2/get/ckinfo.php @@ -31,7 +31,7 @@