From 6a612565c656c1d9b966f69865c2b623ca58f308 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 13 Feb 2020 10:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=8E=A8=E5=B9=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 48 ++++- .../Admin/View/PromoteCompany/add.html | 191 +++++++++++++++++- .../Admin/View/PromoteCompany/addfile.html | 84 ++++++++ Data/update.sql | 11 + 4 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 Application/Admin/View/PromoteCompany/addfile.html diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 1fe22c5d8..1038af82a 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -91,7 +91,7 @@ class PromoteCompanyController extends ThinkController if (empty(I('post.contact_phone'))) { $this->error('请输入联系人电话'); } - $pattern = "/^1[3|5|7|8]\\d{9}$/i"; + $pattern = "/^1[3|4|5|6|7|8|9]\\d{9}$/i"; if(!preg_match($pattern, I('post.contact_phone'))) { $this->error("手机号码格式不合法"); return false; @@ -178,7 +178,7 @@ class PromoteCompanyController extends ThinkController if (empty(I('post.contact_phone'))) { $this->error('请输入联系人电话'); } - $pattern = "/^1[3|5|7|8]\\d{9}$/i"; + $pattern = "/^1[3|4|5|6|7|8|9]\\d{9}$/i";//手机号验证修改 if(!preg_match($pattern, I('post.contact_phone'))) { $this->error("手机号码格式不合法"); return false; @@ -278,4 +278,48 @@ class PromoteCompanyController extends ThinkController $this->success('删除成功', U('lists')); } + //处理上传图片 + 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/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index 0d2b420ed..ee183364c 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -14,7 +14,20 @@ - + +
@@ -24,7 +37,7 @@
-
+
@@ -35,6 +48,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
*公司性质: +
+ +
+
*是否签署合同: +
+ +
+
*团体归属: +
+ +
+
*联系结算人: @@ -97,18 +177,30 @@
文档管理 +
+ 添加 +
+
+ + +
-
- 返回
-
+
@@ -119,7 +211,29 @@ 已添加添加至常用设置
+ @@ -130,4 +244,71 @@ $('#form').submit(); }); + diff --git a/Application/Admin/View/PromoteCompany/addfile.html b/Application/Admin/View/PromoteCompany/addfile.html new file mode 100644 index 000000000..aa56f5d44 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/addfile.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
文件名称: + +
文件选择: + +
+
+
+
确认添加
+
+
+
+ + + + + diff --git a/Data/update.sql b/Data/update.sql index c657086a4..81cf88d47 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1203,3 +1203,14 @@ ALTER TABLE `tab_promote_company` ADD COLUMN `bank_name` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '收款银行' AFTER `bank_cardname`, ADD COLUMN `bank_address` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '开户网点' AFTER `bank_name`, ADD COLUMN `content` VARCHAR(255) NULL DEFAULT '' COMMENT '备注' AFTER `bank_address`; + +--2020-02-11 chenzhi 推广公司录入主体信息增加-- +ALTER TABLE `tab_promote_company` + ADD COLUMN `platform_name` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '平台名称' AFTER `bank_address`, + ADD COLUMN `contact_begin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同开始时间' AFTER `platform_name`, + ADD COLUMN `contact_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同结束时间' AFTER `contact_begin`, + ADD COLUMN `fax_ratio` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '开票税率' AFTER `contact_end`, + ADD COLUMN `company_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '公司性质:1-公司 2-个人' AFTER `fax_ratio`, + ADD COLUMN `is_sign_contact` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否签署合同:0-未签署 1-签署' AFTER `company_type`, + ADD COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属:0-内团;1-外团 2-分发联盟 3 无' AFTER `is_sign_contact`, + ADD COLUMN `resources` VARCHAR(2000) NULL DEFAULT '' COMMENT '文档' AFTER `company_belong`; \ No newline at end of file