diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index 86915179..51aeb77c 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -302,6 +302,12 @@ class Orders extends HD_Controller $agent['company'] = $company; $agent['ins_risk'] = $ins_risk; $agent['business_risk'] = $business_risk; + $insurance_img = json_decode($img_data['insurance_img'],true); + $business_img = json_decode($img_data['business_img'],true); + $agent['insurance_price'] = $insurance_img['price']; + $agent['insurance_product'] = $insurance_img['product']; + $agent['business_price'] = $business_img['price']; + $agent['business_product'] = $business_img['product']; $row['agent'] = $agent; //获取销售员 if ($row['sale_id']) { @@ -1045,16 +1051,10 @@ class Orders extends HD_Controller return $this->show_json(SYS_CODE_FAIL, '参数错误!'); } $agent = $this->order_agents_model->get(['o_id' => $row['id']]); - $jsondata = json_decode($agent['jsondata'],true); $update = []; $update['car_num'] = $params['car_num']; $update['ins_time'] = $params['ins_time'] ? date('Y-m-d H:i:s', strtotime($params['ins_time'])) : '0000-00-00 00:00:00'; - $jsondata['company'] = $params['company']; - $jsondata['ins_risk'] = $params['ins_risk']; - $jsondata['business_risk'] = $params['business_risk']; - - $update['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE); if ($agent) { $result = $this->order_agents_model->update($update, ['id' => $agent['id']]); } else { @@ -1063,6 +1063,18 @@ class Orders extends HD_Controller $result = $this->order_agents_model->add($update); } if ($result) { + $img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id']]); + $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']; + $up_data = [ + 'insurance_img' => json_encode($insurance_img,JSON_UNESCAPED_UNICODE), + 'business_img' => json_encode($business_img,JSON_UNESCAPED_UNICODE) + ]; + $this->receiver_order_datas_model->update($up_data,['o_id'=>$row['id']]); return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); } else { return $this->show_json(SYS_CODE_FAIL, '保存失败'); @@ -1323,4 +1335,54 @@ class Orders extends HD_Controller } return $imgs; } + + public function del_img(){ + $info = $this->input->post(); + if(!$info['type'] || !$info['field']){ + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $res = false; + if($info['type']=='data'){ + $row = $this->receiver_order_datas_model->get(['o_id'=>$info['id']]); + if(!$row){ + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + if($info['field']=='ins_img'){ + $jsondata = json_decode($row[$info['field']],true); + $new_jsondata = []; + foreach ($jsondata as $item) { + if(strpos($info['value'],$item) !== false) { + }else{ + $new_jsondata[] = $item; + } + } + $update = [ + $info['field'] => json_encode($new_jsondata,JSON_UNESCAPED_UNICODE) + ]; + }elseif ($info['field']=='insurance_img'||$info['field']=='business_img'){ + $update = [ + $info['field'] => json_encode([]) + ]; + }else{ + $update = [ + $info['field'] => '' + ]; + } + $res = $this->receiver_order_datas_model->update($update,['o_id'=>$info['id']]); + }elseif($info['type']=='load_info'){ + $row = $this->order_loans_model->get(['o_id'=>$info['id']]); + if(!$row){ + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $update = [ + $info['field'] => '' + ]; + $res = $this->order_loans_model->update($update,['o_id'=>$info['id']]); + } + if($res){ + return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); + }else{ + return $this->show_json(SYS_CODE_FAIL, '保存失败'); + } + } } diff --git a/admin/views/biz/settle/lists_brand.php b/admin/views/biz/settle/lists_brand.php index d1395d12..96658b57 100644 --- a/admin/views/biz/settle/lists_brand.php +++ b/admin/views/biz/settle/lists_brand.php @@ -57,6 +57,7 @@
身份证: -
国补资料:
其它保单: -
交车合照: -