新增合作方时,新增录入内容

新增联系人,联系电话,邮寄地址。公司税号,收款方名称,
银行账号,开户行
master
liuweiwen 5 years ago
parent c20d507df6
commit fa3adf2e0b

@ -92,10 +92,22 @@ class PartnerController extends ThinkController
if ($res) {
$this->error('合作方已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$time = time();
$save['partner'] = $partner;
$save['status'] = $status;
$save['link_man'] = I('link_man');
$save['link_phone'] = I('link_phone');
$save['address'] = I('address');
$save['company_tax_no'] = I('company_tax_no');
$save['payee_name'] = I('payee_name');
$save['bank_account'] = I('bank_account');
$save['opening_bank'] = I('opening_bank');
$save['uid'] = UID;
$save['create_time'] = $time;
$save['last_up_time'] = $time;
@ -131,7 +143,9 @@ class PartnerController extends ThinkController
$this->error('参数异常');
}
$data = $model->field('id,partner')->find($id);
$data = $model
->field('id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
->find($id);
if (empty($data)) {
$this->error('数据异常');
}
@ -142,12 +156,24 @@ class PartnerController extends ThinkController
$this->error('合作方已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$time = time();
$save['id'] = $id;
$save['partner'] = $partner;
$save['link_man'] = I('link_man');
$save['link_phone'] = I('link_phone');
$save['address'] = I('address');
$save['company_tax_no'] = I('company_tax_no');
$save['payee_name'] = I('payee_name');
$save['bank_account'] = I('bank_account');
$save['opening_bank'] = I('opening_bank');
$save['status'] = $status;
$save['last_up_time'] = $time;
$res = $model->save($save);
if ($res === false) {
$this->error('保存失败');
@ -158,7 +184,9 @@ class PartnerController extends ThinkController
} else {
$id = intval(I('get.id', 0));
$map['id'] = $id;
$data = $model->field('id,partner,status')->find($id);
$data = $model
->field('id,partner,status,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
->find($id);
if (empty($data)) {
$this->error('数据异常', U('lists'));
}

@ -35,6 +35,57 @@
<input type="text" class="txt " name="partner" value="" placeholder="请输入合作方名称">
</td>
</tr>
<tr>
<td class="l">联系人:</td>
<td class="r" >
<input type="text" class="txt " name="link_man" value="" placeholder="请输入联系人">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="" placeholder="请输入联系电话">
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r" >
<input type="text" class="txt " name="address" value="" placeholder="请输入邮寄地址">
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r" >
<input type="text" class="txt " name="company_tax_no" value="" placeholder="请输入公司税号">
</td>
</tr>
<tr>
<td class="l">收款方名称:</td>
<td class="r" >
<input type="text" class="txt " name="payee_name" value="" placeholder="请输入收款方名称">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r" >
<input type="text" class="txt " name="bank_account" value="" placeholder="请输入银行账号">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r" >
<input type="text" class="txt " name="opening_bank" value="" placeholder="请输入开户行">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<td class="r table_radio">

@ -35,17 +35,68 @@
<input type="text" class="txt " name="partner" value="{$data.partner}" placeholder="请输入合作方名称">
</td>
</tr>
<tr>
<td class="l">联系人:</td>
<td class="r" >
<input type="text" class="txt " name="link_man" value="{$data.link_man}" placeholder="请输入联系人">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="{$data.link_phone}" placeholder="请输入联系电话">
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r" >
<input type="text" class="txt " name="address" value="{$data.address}" placeholder="请输入邮寄地址">
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r" >
<input type="text" class="txt " name="company_tax_no" value="{$data.company_tax_no}" placeholder="请输入公司税号">
</td>
</tr>
<tr>
<td class="l">收款方名称:</td>
<td class="r" >
<input type="text" class="txt " name="payee_name" value="{$data.payee_name}" placeholder="请输入收款方名称">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r" >
<input type="text" class="txt " name="bank_account" value="{$data.bank_account}" placeholder="请输入银行账号">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r" >
<input type="text" class="txt " name="opening_bank" value="{$data.opening_bank}" placeholder="请输入开户行">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="status"
<eq name="data.status" value="1"> checked </eq>> 开启
<if condition="$data['status']==1"> checked </if>> 开启
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="status"
<eq name="data.status" value="0"> checked </eq>> 关闭
<if condition="$data['status']==0"> checked </if>> 关闭
</label>
</span>
<span class="notice-text"></span>

@ -919,4 +919,12 @@ ADD COLUMN `pay_config` varchar(255) NOT NULL COMMENT '支付渠道 wx 微信 zf
ALTER TABLE tab_promote add `company_belong` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会归属0-内团1-外团';
ALTER TABLE tab_promote add `company_relation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会关系0-自主开发及维护1-只维护';
--, liuweiwen 2020-01-03
ALTER TABLE tab_partner ADD `link_man` varchar(64) DEFAULT '' COMMENT '联系人' AFTER `status`;
ALTER TABLE tab_partner ADD `link_phone` varchar(24) DEFAULT NULL COMMENT '联系电话' AFTER `link_man`;
ALTER TABLE tab_partner ADD `address` varchar(255) DEFAULT NULL COMMENT '邮寄地址' AFTER `link_phone`;
ALTER TABLE tab_partner ADD `company_tax_no` varchar(64) DEFAULT NULL COMMENT '公司税号' AFTER `address`;
ALTER TABLE tab_partner ADD `payee_name` varchar(24) DEFAULT NULL COMMENT '收款方名称' AFTER `company_tax_no`;
ALTER TABLE tab_partner ADD `bank_account` varchar(32) DEFAULT NULL COMMENT '银行账号' AFTER `payee_name`;
ALTER TABLE tab_partner ADD `opening_bank` varchar(128) DEFAULT NULL COMMENT '开户行' AFTER `bank_account`;

Loading…
Cancel
Save