diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index 4cbcfd3c5..d33589800 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -77,6 +77,7 @@ class PartnerController extends ThinkController public function add() { if ($_POST) { + dd($_REQUEST); $partner = I('post.partner', ''); $status = intval(I('post.status', 1)); @@ -119,6 +120,19 @@ class PartnerController extends ThinkController $save['bank_account'] = I('bank_account'); $save['opening_bank'] = I('opening_bank'); + $save['matche_platform'] = I('matche_platform'); + $save['contract_start_time'] = strtotime(I('contract_start_time')); + $save['contract_end_time'] = strtotime(I('contract_end_time')); + $save['channel_rate'] = I('channel_rate'); + $save['invoice_rate'] = I('invoice_rate'); + $save['is_sign_contract'] = I('is_sign_contract'); + $save['settlement_type'] = I('settlement_type'); + $save['has_game_evidence'] = I('has_game_evidence'); + $save['remark'] = I('remark'); + if (isset($save['file_info'])) { + $save['file_info'] = json_encode($save['file_info'],JSON_UNESCAPED_UNICODE); + } + $save['uid'] = UID; $save['create_time'] = $time; $save['last_up_time'] = $time; @@ -245,4 +259,56 @@ class PartnerController extends ThinkController $this->success('删除成功', U('lists')); } + + public function addfile() + { + $this->meta_title = '文档添加'; + return $this->display(); + } + + //处理上传图片 + public function saveFile() + { + $path = '/Uploads/'; + $upload = new \Think\Upload();// 实例化上传类 + $upload->maxSize = 0 ;// 设置附件上传大小 + $upload->exts = '';// 设置附件上传类型 + $upload->rootPath = '.'.$path; // 设置附件上传根目录 + $upload->savePath = ''; // 设置附件上传(子)目录 + // 上传文件 + $info = $upload->upload(); + // dump($info); + if(!$info) {// 上传错误提示错误信息 + $msg = $upload->getError(); + $array= array('status' => 0, 'info' => $msg); + }else{// 上传成功 + $array=array( + "info"=>"上传成功", + "status"=>1, + "file_path"=>$path.$info['file']['savepath'].$info['file']['savename'], + "file_name"=>$_POST['file_name'], + "file_type"=>$_FILES['file']['type'], + "file_size"=>$_FILES['file']['size'], + "upload_time"=>date("Y-m-d H:i:s",time()) + ); + } + $this->ajaxReturn($array); + } + //删除图片 + public function delFile() + { + $id = $_REQUEST['id']; + $index = $_REQUEST['index'] ?: false; + $file_path = $_REQUEST['file_path'] ?: false; + if($id == 0){ + //未存入数据库,不用管 + unlink("./".$file_path); + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "删除成功" + )); + } + # code... + } + } diff --git a/Application/Admin/View/Partner/add.html b/Application/Admin/View/Partner/add.html index 3639ee384..0e6310fd4 100644 --- a/Application/Admin/View/Partner/add.html +++ b/Application/Admin/View/Partner/add.html @@ -14,7 +14,7 @@ - +