diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index 6cb0d725..fae18113 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -243,7 +243,7 @@ class Orders extends HD_Controller{ ]; $bill['id'] = $this->order_bills_model->add($add_data); } - $bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']):''; + $bill['src_file'] = $bill['file'] ? build_qiniu_image_url($bill['file']):''; $this->data['bill'] = $bill; return $this->show_view('receiver/orders/get_bill'); } @@ -251,31 +251,9 @@ class Orders extends HD_Controller{ public function edit_bill(){ $id = $this->input->post('id'); $money = $this->input->post('money'); - $file = $_FILES['file']; - if($file){ //上传文件 - $path = FCPATH.'temp/'; - if (!file_exists($path)){ - $oldumask = umask(0); - mkdir($path, 0777, true); - umask($oldumask); - } - $file_name = md5($file['name'] . uniqid()) . '.'.end(explode('.',$file['name'])); - $tmp = $path.$file_name; - move_uploaded_file($file['tmp_name'], $tmp); - - if (!filesize($tmp)) { - return $this->show_json(SYS_CODE_FAIL, '上传文件失败!'); - } - $this->load->library('qiniu'); - $res= $this->qiniu->save($file_name, file_get_contents($tmp)); - unlink($tmp); - if (!$res) { - return $this->show_json(SYS_CODE_FAIL, '上传文件失败!'); - } - $size = getimagesize($res['url']); - $update['file'] = $res['file']; - } + $file = $this->input->post('file'); $money && $update['money'] = $money; + $file && $update['file'] = $file; $result = $this->order_bills_model->update($update,['id'=>$id]); if($result){ return $this->show_json(SYS_CODE_SUCCESS,'保存成功'); @@ -298,6 +276,9 @@ class Orders extends HD_Controller{ if(!$bill['file'] || !$bill['money']){ return $this->show_json(SYS_CODE_FAIL, '未上传开票文件或未填写到账金额!'); } + if(!$bill['cardidA']){ + return $this->show_json(SYS_CODE_FAIL, '未上传用户身份证!'); + } $result = $this->order_bills_model->update(['status'=>1],['o_id'=>$oid]); $this->orders_model->update(['status'=>4],['id'=>$bill['o_id']]); if(!$this->order_agents_model->get(['o_id'=>$oid])){ @@ -320,7 +301,7 @@ class Orders extends HD_Controller{ $update['if_ins'] = $params['if_ins'] ? 1:0; if($params['bx_imgs']){ $imgs = explode(',',$params['bx_imgs']); - $update['ins_img'] = json_encode($imgs,JSON_UNESCAPED_UNICODE); + $update['bx_imgs'] = json_encode($imgs,JSON_UNESCAPED_UNICODE); } if($agent){ $result = $this->order_agents_model->update($update,['id'=>$agent['id']]); diff --git a/admin/views/receiver/orders/get_bill.php b/admin/views/receiver/orders/get_bill.php index 9d8c7c60..9d1e60cd 100644 --- a/admin/views/receiver/orders/get_bill.php +++ b/admin/views/receiver/orders/get_bill.php @@ -1,5 +1,5 @@