From 6a612565c656c1d9b966f69865c2b623ca58f308 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 13 Feb 2020 10:46:31 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=85=AC=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 From 1f1e75e73696c44e840105ed3d06ef8ebb370cfe Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 13 Feb 2020 13:00:21 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=85=AC=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 | 76 ++++------------- .../Admin/View/PromoteCompany/add.html | 83 ++++++++++++++++++- Public/static/czinputcheck.js | 80 ++++++++++++++++++ 3 files changed, 177 insertions(+), 62 deletions(-) create mode 100644 Public/static/czinputcheck.js diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 1038af82a..066eeff44 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -80,77 +80,35 @@ class PromoteCompanyController extends ThinkController { if ($_POST) { $company_name = I('post.company_name', ''); - $status = intval(I('post.status', 1)); - - if (empty($company_name)) { - $this->error('请输入推广公司名称'); - } - if (empty(I('post.settlement_contact'))) { - $this->error('请输入结算联系人'); - } - if (empty(I('post.contact_phone'))) { - $this->error('请输入联系人电话'); - } - $pattern = "/^1[3|4|5|6|7|8|9]\\d{9}$/i"; - if(!preg_match($pattern, I('post.contact_phone'))) { - $this->error("手机号码格式不合法"); - return false; - } - if (empty(I('post.address'))) { - $this->error('请输入所在地址'); - } - if (empty(I('post.bank_card'))) { - $this->error('请输入银行卡号'); - } - $bank_card_pattern = "/^\d{10,19}$/u"; - if (!preg_match($bank_card_pattern, I('post.bank_card'))) { - $this->error('卡号格式错误'); - return false; - } - if (empty(I('post.bank_cardname'))) { - $this->error('请输入银行卡名'); - } - if (empty(I('post.bank_name'))) { - $this->error('请输入收款银行'); - } - if (empty(I('post.bank_address'))) { - $this->error('请输入开户网点'); - } - if (!in_array($status, [0, 1])) { - $this->error('参数异常'); - } - - if (!empty(I('post.content'))) { - $save['content'] = I('post.content'); - } - $model = M($this->modelName, 'tab_'); $map['company_name'] = $company_name; $res = $model->where($map)->getField('id'); if ($res) { - $this->error('推广公司已存在'); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "推广公司已经存在" + )); } - $time = time(); - $save['company_name'] = $company_name; - $save['status'] = $status; - $save['uid'] = UID; + $save = I('post.');//前端已经验证 $save['create_time'] = $time; $save['last_up_time'] = $time; - $save['settlement_contact'] = I('post.settlement_contact'); - $save['contact_phone'] = I('post.contact_phone'); - $save['address'] = I('post.address'); - $save['bank_card'] = I('post.bank_card'); - $save['bank_cardname'] = I('post.bank_cardname'); - $save['bank_name'] = I('post.bank_name'); - $save['bank_address'] = I('post.bank_address'); - + if(isset($save['resources'])){ + $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); + } $res = $model->add($save); if ($res) { \Think\Log::actionLog('PromoteCompany/add', 'partner', $res); - $this->success('保存成功', U('lists')); + $array=array( + "info"=>"添加成功", + "status"=>1 + ); + $this->ajaxReturn($array); } else { - $this->error('保存失败'); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "保存失败" + )); } } else { $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/add'])->find()); diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index ee183364c..87220142b 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -2,6 +2,8 @@ + + - +
+
-
-
- -
-
- - 搜索 +
+ + +
+
+   +
+ +
+ +
+
+ +
+ +
+ 搜索 +
@@ -77,19 +102,18 @@ 产品类型 游戏名称 合作方分成比例 - - - aOh! 暂时还没有内容! + aOh! 暂时还没有内容! + 查看 编辑 删除 @@ -191,14 +215,14 @@ {$_page|default=''}
-
+ From 6ea7a581f581ffe78cdf9a60d2b7cd2b48a1e753 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 13 Feb 2020 21:25:30 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 21 +- .../Admin/View/PromoteCompany/edit.html | 295 ++++++++++++-- .../Admin/View/PromoteCompany/view.html | 377 ++++++++++++++++++ 3 files changed, 665 insertions(+), 28 deletions(-) create mode 100644 Application/Admin/View/PromoteCompany/view.html diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 1d53d2179..89d8bdefa 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -239,6 +239,20 @@ class PromoteCompanyController extends ThinkController $this->display(); } } + //查看 + public function view() + { + $model = M($this->modelName, 'tab_'); + $id = $_REQUEST['id'] ?: 0; + $map['id'] = $id; + $data = $model->field('*')->find($id); + if (empty($data)) { + $this->error('数据异常', U('lists')); + } + $this->assign('data', $data); + $this->display(); + } + //编辑 public function edit() @@ -322,16 +336,13 @@ class PromoteCompanyController extends ThinkController $this->success('保存成功', U('lists')); } } else { - $id = intval(I('get.id', 0)); + $id = $_REQUEST['id'] ?: 0; $map['id'] = $id; - $data = $model->field('id,company_name,status,settlement_contact,contact_phone,address,bank_card,bank_cardname,bank_name,bank_address,content')->find($id); + $data = $model->field('*')->find($id); if (empty($data)) { $this->error('数据异常', U('lists')); } - $this->assign('data', $data); - $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/edit'])->find()); - $this->meta_title = '编辑推广公司'; $this->display(); } } diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index b064668ed..7a3b0e042 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -2,6 +2,8 @@ + +
@@ -24,7 +42,7 @@
-
+
@@ -35,52 +53,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -88,49 +173,213 @@ + + + + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
*公司性质: +
+ +
+
*是否签署合同: +
+ +
+
*团体归属: +
+ +
+
*联系结算人: - +
*联系电话: - +
*所在地址: - +
*银行卡号: - +
*收款银行: - +
*开户网点: - +
备注: - +
文档管理 +
+ 添加 +
+
+ + +
-
- - - + 返回
-
+
+
+ diff --git a/Application/Admin/View/PromoteCompany/view.html b/Application/Admin/View/PromoteCompany/view.html new file mode 100644 index 000000000..8b16d5be3 --- /dev/null +++ b/Application/Admin/View/PromoteCompany/view.html @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
推广公司名称: + +
对应平台(简称): + +
合同期限: +
+ +  -  +
+ + +
+
+
开票税点: + + % +
公司性质: +
+ +
+
是否签署合同: +
+ +
+
团体归属: +
+ +
+
联系结算人: + +
联系电话: + +
所在地址: + +
银行卡号: + +
收款银行: + +
开户网点: + +
备注: + +
显示状态: + + + + + +
+ + +
+
+
+
+
+ + +
+ + + + + From 4e28b399995962f92f9d5fbbf03e027bef38b54c Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 13 Feb 2020 22:05:38 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 115 +++++------- .../Admin/View/PromoteCompany/edit.html | 176 ++++++++++-------- 2 files changed, 145 insertions(+), 146 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 89d8bdefa..50ceddccc 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -249,6 +249,8 @@ class PromoteCompanyController extends ThinkController if (empty($data)) { $this->error('数据异常', U('lists')); } + $data['contact_begin']=date("Y-m-d",$data['contact_begin']); + $data['contact_end']=date("Y-m-d",$data['contact_end']); $this->assign('data', $data); $this->display(); } @@ -260,80 +262,29 @@ class PromoteCompanyController extends ThinkController $model = M($this->modelName, 'tab_'); if ($_POST) { - $company_name = I('post.company_name', ''); - $status = intval(I('post.status', 1)); - $id = intval(I('post.id', 0)); - - if (empty($company_name)) { - $this->error('请输入推广公司名称'); - } - if (empty(I('post.settlement_contact'))) { - $this->error('请输入结算联系人'); - } - if (empty(I('post.contact_phone'))) { - $this->error('请输入联系人电话'); - } - $pattern = "/^1[3|4|5|6|7|8|9]\\d{9}$/i";//手机号验证修改 - if(!preg_match($pattern, I('post.contact_phone'))) { - $this->error("手机号码格式不合法"); - return false; - } - if (empty(I('post.address'))) { - $this->error('请输入所在地址'); - } - if (empty(I('post.bank_card'))) { - $this->error('请输入银行卡号'); - } - $bank_card_pattern = "/^\d{10,19}$/u"; - if (!preg_match($bank_card_pattern, I('post.bank_card'))) { - $this->error('卡号格式错误'); - return false; - } - if (empty(I('post.bank_cardname'))) { - $this->error('请输入银行卡名'); - } - if (empty(I('post.bank_name'))) { - $this->error('请输入收款银行'); - } - if (empty(I('post.bank_address'))) { - $this->error('请输入开户网点'); - } - if (!in_array($status, [0, 1]) || $id == 0) { - $this->error('参数异常'); - } - if (!empty(I('post.content'))) { - $save['content'] = I('post.content'); - } - $data = $model->field('id,company_name')->find($id); - if (empty($data)) { - $this->error('数据异常'); - } - - $map['company_name'] = $company_name; - $res = $model->where($map)->getField('id'); - if ($res && $res != $id) { - $this->error('推广公司已存在'); - } - $time = time(); - $save['id'] = $id; - $save['company_name'] = $company_name; - $save['status'] = $status; + $save = I('post.');//前端已经验证 + $save['create_time'] = $time; $save['last_up_time'] = $time; - $save['settlement_contact'] = I('post.settlement_contact'); - $save['contact_phone'] = I('post.contact_phone'); - $save['address'] = I('post.address'); - $save['bank_card'] = I('post.bank_card'); - $save['bank_cardname'] = I('post.bank_cardname'); - $save['bank_name'] = I('post.bank_name'); - $save['bank_address'] = I('post.bank_address'); - + $save['contact_begin']=strtotime($save['contact_begin']); + $save['contact_end']=strtotime($save['contact_end']); + + if(isset($save['resources'])){ + $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); + } $res = $model->save($save); - if ($res === false) { - $this->error('保存失败'); + if ($res) { + \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); + $array=array( + "info"=>"修改成功", + "status"=>1 + ); + $this->ajaxReturn($array); } else { - \Think\Log::actionLog('PromoteCompany/edit', 'PromoteCompany', $id); - $this->success('保存成功', U('lists')); + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "修改失败" + )); } } else { $id = $_REQUEST['id'] ?: 0; @@ -342,6 +293,9 @@ class PromoteCompanyController extends ThinkController if (empty($data)) { $this->error('数据异常', U('lists')); } + $data['contact_begin']=date("Y-m-d",$data['contact_begin']); + $data['contact_end']=date("Y-m-d",$data['contact_end']); + $this->assign('data', $data); $this->display(); } @@ -402,15 +356,30 @@ class PromoteCompanyController extends ThinkController public function delFile() { $id = $_REQUEST['id']; - $index = $_REQUEST['index'] ?: false; $file_path = $_REQUEST['file_path'] ?: false; + unlink("./".$file_path); if($id == 0){ - //未存入数据库,不用管 - unlink("./".$file_path); $this->ajaxReturn(array( 'status' => 1, 'info' => "删除成功" )); + }else{ + //需要修改 + $array = array( + "resources"=>json_encode($_REQUEST['resources'],JSON_UNESCAPED_UNICODE) + ); + $res = M($this->modelName, 'tab_')->where("id='{$id}'")->save($array); + if($res === false){ + $this->ajaxReturn(array( + 'status' => 0, + 'info' => "删除保存失败" + )); + }else{ + $this->ajaxReturn(array( + 'status' => 1, + 'info' => "删除成功" + )); + } } # code... } diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 7a3b0e042..015297b55 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -37,7 +37,7 @@
@@ -63,11 +63,11 @@ 合同期限:
-  - 
-
@@ -77,7 +77,7 @@ 开票税点: - + % @@ -87,8 +87,10 @@
@@ -99,8 +101,10 @@
@@ -111,10 +115,14 @@
@@ -123,25 +131,25 @@ *联系结算人: - + *联系电话: - + *所在地址: - + *银行卡号: - + + + + 合作方名称 + 对应平台 + 合同期限 + 开票税点 + 开户行 + 银行账号 + 是否签署合同 + 备注 + + 会长账号 + 结算周期 + 产品类型 + 游戏名称 + 合作方分成比例 + + + + + + + aOh! 暂时还没有内容! + + + + {$data.company_name} + {$data.platform_name} + {$data.contact_begin} - {$data.contact_end} + {$data.fax_ratio}% + {$data.bank_name} + {$data.bank_card} + {$data.is_sign_contact} + {$data.content} + + + + + {$promote['account']} + {$promote['settlement_type']} + + + + {$game['game_type_name']} + {$game['relation_game_name']} + + + + {$ratio['name']} + {$ratio['ratio']} + + + {$ratio['name']} + {$ratio['ratio']} + + + + + {$game['game_type_name']} + {$game['relation_game_name']} + + + + {$ratio['name']} + {$ratio['ratio']} + + + {$ratio['name']} + {$ratio['ratio']} + + + + + + + {$promote['account']} + {$promote['settlement_type']} + + + {$game['game_type_name']} + {$game['relation_game_name']} + + + + {$ratio['name']} + {$ratio['ratio']} + + + {$ratio['name']} + {$ratio['ratio']} + + + + + {$game['game_type_name']} + {$game['relation_game_name']} + + + + {$ratio['name']} + {$ratio['ratio']} + + + {$ratio['name']} + {$ratio['ratio']} + + + + + + + + + + + + + + + + + + diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index 34766efc3..9b4d36746 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -76,6 +76,9 @@ +
@@ -266,6 +269,19 @@ window.location.href = url; }); + $("#downloadexcel").on("click",function(){ + var url = $(this).attr("url"); + var title = '推广公司导出'; + layer.open({ + type: 2, + title: title, + shadeClose: true, + shade: 0.8, + area: ['40%', '60%'], + content: url + + }); + }) //回车自动提交 $('.jssearch').find('input').keyup(function(event){ diff --git a/Public/static/table2excel.js b/Public/static/table2excel.js new file mode 100644 index 000000000..d4427f88c --- /dev/null +++ b/Public/static/table2excel.js @@ -0,0 +1 @@ +(function($,window,document,undefined){var pluginName="table2excel",defaults={exclude:".noExl",name:"Table2Excel",filename:"table2excel",fileext:".xls",exclude_img:true,exclude_links:true,exclude_inputs:true,preserveColors:false};function Plugin(element,options){this.element=element;this.settings=$.extend({},defaults,options);this._defaults=defaults;this._name=pluginName;this.init()}Plugin.prototype={init:function(){var e=this;var utf8Heading='';e.template={head:''+utf8Heading+"",table:{head:"",tail:"
"},foot:""};e.tableRows=[];var additionalStyles="";var compStyle=null;$(e.element).each(function(i,o){var tempRows="";$(o).find("tr").not(e.settings.exclude).each(function(i,p){additionalStyles="";if(e.settings.preserveColors){compStyle=getComputedStyle(p);additionalStyles+=(compStyle&&compStyle.backgroundColor?"background-color: "+compStyle.backgroundColor+";":"");additionalStyles+=(compStyle&&compStyle.color?"color: "+compStyle.color+";":"")}tempRows+="";$(p).find("td,th").not(e.settings.exclude).each(function(i,q){additionalStyles="";if(e.settings.preserveColors){compStyle=getComputedStyle(q);additionalStyles+=(compStyle&&compStyle.backgroundColor?"background-color: "+compStyle.backgroundColor+";":"");additionalStyles+=(compStyle&&compStyle.color?"color: "+compStyle.color+";":"")}var rc={rows:$(this).attr("rowspan"),cols:$(this).attr("colspan"),flag:$(q).find(e.settings.exclude)};if(rc.flag.length>0){tempRows+=" "}else{tempRows+="0){tempRows+=" rowspan='"+rc.rows+"' "}if(rc.cols>0){tempRows+=" colspan='"+rc.cols+"' "}if(additionalStyles){tempRows+=" style='"+additionalStyles+"'"}tempRows+=">"+$(q).html()+""}});tempRows+=""});if(e.settings.exclude_img){tempRows=exclude_img(tempRows)}if(e.settings.exclude_links){tempRows=exclude_links(tempRows)}if(e.settings.exclude_inputs){tempRows=exclude_inputs(tempRows)}e.tableRows.push(tempRows)});e.tableToExcel(e.tableRows,e.settings.name,e.settings.sheetName)},tableToExcel:function(table,name,sheetName){var e=this,fullTemplate="",i,link,a;e.format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p]})};sheetName=typeof sheetName==="undefined"?"Sheet":sheetName;e.ctx={worksheet:name||"Worksheet",table:table,sheetName:sheetName};fullTemplate=e.template.head;if($.isArray(table)){Object.keys(table).forEach(function(i){fullTemplate+=e.template.sheet.head+sheetName+i+e.template.sheet.tail})}fullTemplate+=e.template.mid;if($.isArray(table)){Object.keys(table).forEach(function(i){fullTemplate+=e.template.table.head+"{table"+i+"}"+e.template.table.tail})}fullTemplate+=e.template.foot;for(i in table){e.ctx["table"+i]=table[i]}delete e.ctx.table;var isIE=navigator.appVersion.indexOf("MSIE 10")!==-1||(navigator.userAgent.indexOf("Trident")!==-1&&navigator.userAgent.indexOf("rv:11")!==-1);if(isIE){if(typeof Blob!=="undefined"){fullTemplate=e.format(fullTemplate,e.ctx);fullTemplate=[fullTemplate];var blob1=new Blob(fullTemplate,{type:"text/html"});window.navigator.msSaveBlob(blob1,getFileName(e.settings))}else{txtArea1.document.open("text/html","replace");txtArea1.document.write(e.format(fullTemplate,e.ctx));txtArea1.document.close();txtArea1.focus();sa=txtArea1.document.execCommand("SaveAs",true,getFileName(e.settings))}}else{var blob=new Blob([e.format(fullTemplate,e.ctx)],{type:"application/vnd.ms-excel"});window.URL=window.URL||window.webkitURL;link=window.URL.createObjectURL(blob);a=document.createElement("a");a.download=getFileName(e.settings);a.href=link;document.body.appendChild(a);a.click();document.body.removeChild(a)}return true}};function getFileName(settings){return(settings.filename?settings.filename:"table2excel")}function exclude_img(string){var _patt=/(\s+alt\s*=\s*"([^"]*)"|\s+alt\s*=\s*'([^']*)')/i;return string.replace(/]*>/gi,function myFunction(x){var res=_patt.exec(x);if(res!==null&&res.length>=2){return res[2]}else{return""}})}function exclude_links(string){return string.replace(/]*>|<\/a>/gi,"")}function exclude_inputs(string){var _patt=/(\s+value\s*=\s*"([^"]*)"|\s+value\s*=\s*'([^']*)')/i;return string.replace(/]*>|<\/input>/gi,function myFunction(x){var res=_patt.exec(x);if(res!==null&&res.length>=2){return res[2]}else{return""}})}$.fn[pluginName]=function(options){var e=this;e.each(function(){if(!$.data(e,"plugin_"+pluginName)){$.data(e,"plugin_"+pluginName,new Plugin(this,options))}});return e}})(jQuery,window,document); \ No newline at end of file From 6bb3387b0e59ea0f0bae078988ccde2ef646d799 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 14 Feb 2020 16:29:01 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E5=88=86=E6=88=90=E6=AF=94=E4=BE=8B=E7=99=BE?= =?UTF-8?q?=E5=88=86=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteCompanyController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 18de5eb23..1cc6d854c 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -81,11 +81,11 @@ class PromoteCompanyController extends ThinkController foreach($gameradiores as $k=>$v){ $turnover_ratio = json_decode($v['turnover_ratio'],true); $v['turnover_ratio'] = array( - array("ratio"=>$v['ratio'],"name"=>"默认比例") + array("ratio"=>$v['ratio']."%","name"=>"默认比例") ); foreach($turnover_ratio as $ke=>$va){ - $t=array("ratio"=>$va["ratio"]); + $t=array("ratio"=>$va["ratio"]."%"); if(array_key_exists("instanceof",$va)){ //存在 if($va['instanceof']=='1'){ From e1ab1eade6495c0e88eb92d47478e7464fc76b07 Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Fri, 14 Feb 2020 17:32:03 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0SQL=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index c2e2bfc62..27f0d8168 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1103,7 +1103,6 @@ ALTER TABLE `tab_promote_belong` ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显示充值数据 0否 1是'; -- 添加测试订单录入表 郑昌隆 2020-02-12 -DROP TABLE IF EXISTS `tab_test_order`; CREATE TABLE `tab_test_order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_type` tinyint(2) DEFAULT '0' COMMENT '0-未知,1-sdk充值,2-平台币充值,3-超级签充值',