From 3b6f8c70ccb06349933bbbc201796239fcee2b1c Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 12 May 2020 17:52:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 3 +++ .../Admin/View/PromoteCompany/edit.html | 18 +++++++++--------- Public/static/czinputcheck.js | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index d4825c0dd..89a3ec7dc 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -361,6 +361,9 @@ class PromoteCompanyController extends ThinkController }else{ $data['contact_begin']=''; } + if(empty($data['contact_phone'])){ + $data['contact_phone'] = ''; + } if($data['contact_end'] >0){ $data['contact_end']=date("Y-m-d",$data['contact_end']); }else{ diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 6a766e28f..5e40d7463 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -354,19 +354,19 @@ $("#submit").on("click",function(){ var obj = { "company_name":["required","推广公司名称不允许为空"], - "platform_name":["nocheck"], - "contact_begin":["nocheck","合同开始时间不能为空"], - "contact_end":["nocheck","合同结束时间不能为空"], + "platform_name":[["nocheck",true]], + "contact_begin":[["nocheck",true],"合同开始时间不能为空"], + "contact_end":[["nocheck",true],"合同结束时间不能为空"], "fax_ratio":[["number",true],"开票税率必须是数字,如果无此项请填0"], "company_type":["nocheck","公司性质不能为空","select"], "is_sign_contact":["nocheck","是否签署合同项不能为空","select"], "company_belong":["nocheck","团体归属不能为空","select"], - "settlement_contact":["nocheck","结算联系人不能为空"], + "settlement_contact":[["nocheck",true],"结算联系人不能为空"], "contact_phone":[["phone",true],"联系人电话格式不对"], - "address":["nocheck","联系人地址不能为空"], + "address":[["nocheck",true],"联系人地址不能为空"], "bank_card":[["bankid",true],"银行卡格式错误"], - "bank_name":["nocheck","银行名称不能为空"], - "bank_address":["nocheck","银行开户网点不能为空"], + "bank_name":[["nocheck",true],"银行名称不能为空"], + "bank_address":[["nocheck",true],"银行开户网点不能为空"], "content":["nocheck"], "status":["nocheck","","radio"] } @@ -382,7 +382,7 @@ cres.resources = doc; cres.id = id; - + console.log(cres); //添加 $.ajax({ url:"{:U('PromoteCompany/edit')}", @@ -392,7 +392,7 @@ success:function(data){ if(data.status == 1){ layer.msg(data.info,function(){ - window.location.href="{:U('PromoteCompany/lists')}"; + // window.location.href="{:U('PromoteCompany/lists')}"; }); }else{ layer.msg(data.info); diff --git a/Public/static/czinputcheck.js b/Public/static/czinputcheck.js index 1367f3835..64ad70367 100644 --- a/Public/static/czinputcheck.js +++ b/Public/static/czinputcheck.js @@ -47,6 +47,7 @@ //为true不存在不报错 if(reg[1]){ if(val == ''){ + rearr[i]=val; continue; } } From 644100dc3b77448efa1a666f9461882eda1c32e6 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 12 May 2020 18:03:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/PromoteCompany/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 5e40d7463..c73a20e37 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -392,7 +392,7 @@ success:function(data){ if(data.status == 1){ layer.msg(data.info,function(){ - // window.location.href="{:U('PromoteCompany/lists')}"; + window.location.href="{:U('PromoteCompany/lists')}"; }); }else{ layer.msg(data.info); From 644e38fd1f37ad4386cc3104f1c63258d11bb1fc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 12 May 2020 18:07:07 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A9=BA=E5=80=BC3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/PromoteCompany/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index c73a20e37..967008ee5 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -367,7 +367,7 @@ "bank_card":[["bankid",true],"银行卡格式错误"], "bank_name":[["nocheck",true],"银行名称不能为空"], "bank_address":[["nocheck",true],"银行开户网点不能为空"], - "content":["nocheck"], + "content":[["nocheck",true]], "status":["nocheck","","radio"] } var cres = CIC.checkAddInput(obj); From 4ebe2780cc664c1f2dbafe5e322c4e55366e271d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 12 May 2020 18:17:48 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E4=BF=AE=E6=94=B94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteCompanyController.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 89a3ec7dc..161123c12 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -326,6 +326,9 @@ class PromoteCompanyController extends ThinkController if(isset($save['company_belong']) && ($y_belong != $save['company_belong'])){ $is_change_belong = true; } + if(empty($save['contact_phone'])){ + $save['contact_phone'] = NULL; + } $res = $model->save($save); if ($res) { \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); From 42a9b318fb1637f38c810012c1f0632f30258744 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 12 May 2020 18:24:31 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E4=BF=AE=E6=94=B95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteCompanyController.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 161123c12..9f434f15b 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -252,6 +252,9 @@ class PromoteCompanyController extends ThinkController if(isset($save['resources'])){ $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); } + if(empty($save['contact_phone'])){ + $save['contact_phone'] = 0; + } $res = $model->add($save); if ($res) { @@ -327,7 +330,7 @@ class PromoteCompanyController extends ThinkController $is_change_belong = true; } if(empty($save['contact_phone'])){ - $save['contact_phone'] = NULL; + $save['contact_phone'] = 0; } $res = $model->save($save); if ($res) {