diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index a54bde68..27b388f3 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -114,8 +114,6 @@ class Orders extends HD_Controller $row['entrust_name'] = $row['info_json']['entrust_name'] ? $row['info_json']['entrust_name'] : ''; $row['entrust_idcard'] = $row['info_json']['entrust_idcard'] ? $row['info_json']['entrust_idcard'] : ''; $row['credit'] = $row['info_json']['c_credit'] ? $row['info_json']['c_credit'] : ''; - $row['business_licence'] = $row['info_json']['business_licence'] ? array('value' => $row['info_json']['business_licence'] - , 'src' => build_qiniu_image_url($row['info_json']['business_licence'])) : array('value' => '', 'src' => ''); $row['note'] = $jsondata['note'] ? $jsondata['note'] : ''; //获取车信息 $brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name'); @@ -150,10 +148,11 @@ class Orders extends HD_Controller $row['loan_info'] = $loan; } //获取开票 - $bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB'); + $bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB,business_licence'); $bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : ''; $bill['cardidA'] = $bill['cardidA'] ? array('value' => $bill['cardidA'], 'src' => build_qiniu_image_url($bill['cardidA'])) : array('value' => '', 'src' => ''); $bill['cardidB'] = $bill['cardidB'] ? array('value' => $bill['cardidB'], 'src' => build_qiniu_image_url($bill['cardidB'])) : array('value' => '', 'src' => ''); + $bill['business_licence'] = $bill['business_licence'] ? array('value' => $bill['business_licence'], 'src' => build_qiniu_image_url($bill['business_licence'])) : array('value' => '', 'src' => ''); $bill['status'] = intval($bill['status']); $row['bill'] = $bill; //获取合同文件 @@ -256,13 +255,21 @@ class Orders extends HD_Controller public function edit() { $params = $this->input->post(); - $re = $this->orders_model->get(['id' => $params['id']]); + if (!$params['id']) { + return $this->show_json(SYS_CODE_FAIL, '参数错误!'); + } $result = ''; if ($params['type'] == 1) {//修改备注 + $re = $this->orders_model->get(['id' => $params['id']]); $jsondata = json_decode($re['jsondata'], true); $jsondata['note'] = $params['note']; $upd = array('jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)); $result = $this->orders_model->update($upd, ['id' => $params['id']]); + } else if ($params['type'] == 2) {//修改营业执照 + if (!$params['business_licence']) { + return $this->show_json(SYS_CODE_FAIL, '请上传营业执照'); + } + $result = $this->order_bills_model->update(array('business_licence' => $params['business_licence']), ['o_id' => $params['id']]); } if ($result) { return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); @@ -310,31 +317,6 @@ class Orders extends HD_Controller } } - /** - * Notes:更新营业执照 - * Created on: 2021/9/26 10:02 - * Created by: dengbw - * @return bool - */ - function edit_business_licence() - { - $id = $this->input->post('id'); - $business_licence = $this->input->post('business_licence'); - if (!$business_licence) { - return $this->show_json(SYS_CODE_FAIL, '请上传营业执照'); - } - $row = $this->orders_model->get(['id' => $id]); - $info_json = json_decode($row['info_json'], true); - $info_json['business_licence'] = $business_licence; - $upd = array('info_json' => json_encode($info_json, JSON_UNESCAPED_UNICODE)); - $result = $this->orders_model->update($upd, ['id' => $id]); - if ($result) { - return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); - } else { - return $this->show_json(SYS_CODE_FAIL, '保存失败'); - } - } - //删除单条数据 public function del() { diff --git a/admin/views/receiver/orders/agentinfo.php b/admin/views/receiver/orders/agentinfo.php index 85da50af..0fcdd657 100644 --- a/admin/views/receiver/orders/agentinfo.php +++ b/admin/views/receiver/orders/agentinfo.php @@ -8,14 +8,14 @@