From 7b6eceb75d0caa395955f487d5738ecaafbbf823 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Tue, 7 Feb 2023 17:24:07 +0800 Subject: [PATCH] edit-admin-accident_ins --- admin/controllers/receiver/orderv2/Orders.php | 22 +++++-------------- admin/views/receiver/orderv2/get/ckinfo.php | 22 +++++++++++++++++++ .../libraries/receiver/Order_datas_entity.php | 8 ++++--- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index 4ee5a6c0..a20232a4 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -445,7 +445,6 @@ 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); @@ -512,13 +511,14 @@ class Orders extends HD_Controller $agent['business_risk'] = $business_risk; $insurance_img = json_decode($img_data['insurance_img'],true); $business_img = json_decode($img_data['business_img'],true); + $accident_img = json_decode($img_data['accident_img'],true); $agent['insurance_price'] = $insurance_img['price'] ? $insurance_img['price'] : ''; $agent['insurance_product'] = $insurance_img['product'] ? $insurance_img['product'] : ''; $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'] : ''; + $agent['accident_price'] = $accident_img['price'] ? $accident_img['price'] : ''; + $agent['accident_title'] = $accident_img['product'] ? $accident_img['product'] : ''; 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'])); @@ -1213,12 +1213,12 @@ class Orders extends HD_Controller $update = [ $field => $save_value ]; - if($field=='insurance_img'||$field=='business_img'){ + if($field=='insurance_img'||$field=='business_img' || $field=='accident_img'){ $jsondata = json_decode($re_data['jsondata'],true); $img_url = build_qiniu_image_url($value); // $result = $this->qiniuorc->car_insure($img_url); $result = $this->tcmarket->autoInsurance($img_url); - if (!$result['code']) { + if (!$result['code'] && $field!='accident_img') { //意外险不强制识别成功 return $this->show_json(SYS_CODE_FAIL, '图片识别失败,请重新上传'); } // $img_jsondata = [ @@ -1247,18 +1247,6 @@ 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'){//更新车牌号 diff --git a/admin/views/receiver/orderv2/get/ckinfo.php b/admin/views/receiver/orderv2/get/ckinfo.php index bdeecc8b..4aa61f7a 100644 --- a/admin/views/receiver/orderv2/get/ckinfo.php +++ b/admin/views/receiver/orderv2/get/ckinfo.php @@ -269,6 +269,28 @@