From 50462e3470e0ba1168bd4c1168c35dfb664671c5 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 7 May 2020 18:29:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E4=BD=9C=E6=96=B9?= =?UTF-8?q?=E5=BF=85=E5=A1=AB=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PartnerController.class.php | 54 +++++++++---------- Application/Admin/View/Partner/add.html | 40 +++++++------- Application/Admin/View/Partner/edit.html | 25 +++++---- 3 files changed, 55 insertions(+), 64 deletions(-) diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index b01fb2cf7..a469ac93d 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -209,21 +209,12 @@ class PartnerController extends ThinkController if (!strlen(I('is_sign_contract'))) { $this->error('请选择是否签署合同'); } - if (empty(I('settlement_type'))) { - $this->error('请选择结算方式'); - } if (empty(I('company_type'))) { $this->error('请输入公司性质'); } if (!strlen(I('has_game_evidence'))) { $this->error('请选择是否有游戏资质'); } - if (empty(I('link_man'))) { - $this->error('请输入联系人'); - } - if (empty(I('link_phone'))) { - $this->error('请输入联系电话'); - } @@ -234,13 +225,16 @@ class PartnerController extends ThinkController $this->error('合作方已存在'); } - if(!checkPhone(I('link_phone'))) { + if(!empty(I('link_phone')) && !checkPhone(I('link_phone'))) { $this->error('联系电话格式不正确'); } - $res2 = $model->where(['link_phone' => I('link_phone')])->getField('id'); - if ($res2) { - $this->error('已存在此联系电话'); + if(!empty(I('link_phone'))){ + $res2 = $model->where(['link_phone' => I('link_phone')])->getField('id'); + if ($res2) { + $this->error('已存在此联系电话'); + } } + $time = time(); $save['partner'] = $partner; $save['status'] = $status; @@ -307,21 +301,12 @@ class PartnerController extends ThinkController if (!strlen(I('is_sign_contract'))) { $this->error('请选择是否签署合同'); } - if (empty(I('settlement_type'))) { - $this->error('请选择结算方式'); - } if (empty(I('company_type'))) { $this->error('请输入公司性质'); } if (!strlen(I('has_game_evidence'))) { $this->error('请选择是否有游戏资质'); } - if (empty(I('link_man'))) { - $this->error('请输入联系人'); - } - if (empty(I('link_phone'))) { - $this->error('请输入联系电话'); - } $data = $model ->field('id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank') @@ -336,17 +321,20 @@ class PartnerController extends ThinkController $this->error('合作方已存在'); } - if(!checkPhone(I('link_phone'))) { + if(!empty(I('link_phone')) && !checkPhone(I('link_phone'))) { $this->error('联系电话格式不正确'); } - $res2 = $model->where([ - 'link_phone' => I('link_phone'), - 'id' => ['neq', $id] - ])->getField('id'); - - if ($res2) { - $this->error('已存在此联系电话'); + if(!empty(I('link_phone'))){ + $res2 = $model->where([ + 'link_phone' => I('link_phone'), + 'id' => ['neq', $id] + ])->getField('id'); + + if ($res2) { + $this->error('已存在此联系电话'); + } } + $time = time(); $save['id'] = $id; $save['partner'] = $partner; @@ -394,11 +382,17 @@ class PartnerController extends ThinkController if (empty($data)) { $this->error('数据异常', U('lists')); } + + if ($data['contract_start_time']) { $data['contract_start_time'] = date('Y-m-d', $data['contract_start_time']); + }else{ + $data['contract_start_time']=''; } if ($data['contract_end_time']) { $data['contract_end_time'] = date('Y-m-d', $data['contract_end_time']); + }else{ + $data['contract_end_time']=''; } $data['channel_rate'] *= 100;//存的是小数,显示百分比 $data['invoice_rate'] *= 100;//存的是小数,显示百分比 diff --git a/Application/Admin/View/Partner/add.html b/Application/Admin/View/Partner/add.html index 596e41090..21668bac2 100644 --- a/Application/Admin/View/Partner/add.html +++ b/Application/Admin/View/Partner/add.html @@ -37,7 +37,7 @@ - 对应平台(简称): + 对应平台(简称): @@ -52,14 +52,14 @@ - 渠道费率: + 渠道费率: % - 开票税点: + 开票税点: % @@ -68,58 +68,56 @@ - *是否签署合同: + 是否签署合同: - *结算方式: + 结算方式: - *公司性质: + 公司性质: - *是否有游戏资质: + 是否有游戏资质: - *联系人: + 联系人: - *联系电话: + 联系电话: diff --git a/Application/Admin/View/Partner/edit.html b/Application/Admin/View/Partner/edit.html index f9a18a55e..974e1296c 100644 --- a/Application/Admin/View/Partner/edit.html +++ b/Application/Admin/View/Partner/edit.html @@ -37,7 +37,7 @@ - 对应平台(简称): + 对应平台(简称): @@ -52,14 +52,14 @@ - 渠道费率: + 渠道费率: % - 开票税点: + 开票税点: % @@ -68,10 +68,10 @@ - *是否签署合同: + 是否签署合同: @@ -79,10 +79,10 @@ - *结算方式: + 结算方式: @@ -90,10 +90,9 @@ - *公司性质: + 公司性质: @@ -101,10 +100,10 @@ - *是否有游戏资质: + 是否有游戏资质: @@ -112,14 +111,14 @@ - *联系人: + 联系人: - *联系电话: + 联系电话: