Merge branch 'fix/admin_second_optimization' of wmtx/platform into master

优化空值修改
master
廖金灵 5 years ago committed by Gogs
commit 2d7189a224

@ -252,6 +252,9 @@ class PromoteCompanyController extends ThinkController
if(isset($save['resources'])){ if(isset($save['resources'])){
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
} }
if(empty($save['contact_phone'])){
$save['contact_phone'] = 0;
}
$res = $model->add($save); $res = $model->add($save);
if ($res) { if ($res) {
@ -326,6 +329,9 @@ class PromoteCompanyController extends ThinkController
if(isset($save['company_belong']) && ($y_belong != $save['company_belong'])){ if(isset($save['company_belong']) && ($y_belong != $save['company_belong'])){
$is_change_belong = true; $is_change_belong = true;
} }
if(empty($save['contact_phone'])){
$save['contact_phone'] = 0;
}
$res = $model->save($save); $res = $model->save($save);
if ($res) { if ($res) {
\Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res);
@ -361,6 +367,9 @@ class PromoteCompanyController extends ThinkController
}else{ }else{
$data['contact_begin']=''; $data['contact_begin']='';
} }
if(empty($data['contact_phone'])){
$data['contact_phone'] = '';
}
if($data['contact_end'] >0){ if($data['contact_end'] >0){
$data['contact_end']=date("Y-m-d",$data['contact_end']); $data['contact_end']=date("Y-m-d",$data['contact_end']);
}else{ }else{

@ -354,20 +354,20 @@
$("#submit").on("click",function(){ $("#submit").on("click",function(){
var obj = { var obj = {
"company_name":["required","推广公司名称不允许为空"], "company_name":["required","推广公司名称不允许为空"],
"platform_name":["nocheck"], "platform_name":[["nocheck",true]],
"contact_begin":["nocheck","合同开始时间不能为空"], "contact_begin":[["nocheck",true],"合同开始时间不能为空"],
"contact_end":["nocheck","合同结束时间不能为空"], "contact_end":[["nocheck",true],"合同结束时间不能为空"],
"fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"], "fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"],
"company_type":["nocheck","公司性质不能为空","select"], "company_type":["nocheck","公司性质不能为空","select"],
"is_sign_contact":["nocheck","是否签署合同项不能为空","select"], "is_sign_contact":["nocheck","是否签署合同项不能为空","select"],
"company_belong":["nocheck","团体归属不能为空","select"], "company_belong":["nocheck","团体归属不能为空","select"],
"settlement_contact":["nocheck","结算联系人不能为空"], "settlement_contact":[["nocheck",true],"结算联系人不能为空"],
"contact_phone":[["phone",true],"联系人电话格式不对"], "contact_phone":[["phone",true],"联系人电话格式不对"],
"address":["nocheck","联系人地址不能为空"], "address":[["nocheck",true],"联系人地址不能为空"],
"bank_card":[["bankid",true],"银行卡格式错误"], "bank_card":[["bankid",true],"银行卡格式错误"],
"bank_name":["nocheck","银行名称不能为空"], "bank_name":[["nocheck",true],"银行名称不能为空"],
"bank_address":["nocheck","银行开户网点不能为空"], "bank_address":[["nocheck",true],"银行开户网点不能为空"],
"content":["nocheck"], "content":[["nocheck",true]],
"status":["nocheck","","radio"] "status":["nocheck","","radio"]
} }
var cres = CIC.checkAddInput(obj); var cres = CIC.checkAddInput(obj);
@ -382,7 +382,7 @@
cres.resources = doc; cres.resources = doc;
cres.id = id; cres.id = id;
console.log(cres);
//添加 //添加
$.ajax({ $.ajax({
url:"{:U('PromoteCompany/edit')}", url:"{:U('PromoteCompany/edit')}",

@ -47,6 +47,7 @@
//为true不存在不报错 //为true不存在不报错
if(reg[1]){ if(reg[1]){
if(val == ''){ if(val == ''){
rearr[i]=val;
continue; continue;
} }
} }

Loading…
Cancel
Save