优化合作方必填项

master
chenzhi 5 years ago
parent e770a00cbb
commit 50462e3470

@ -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;//存的是小数,显示百分比

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->对应平台(简称)</td>
<td class="l">对应平台(简称)</td>
<td class="r" >
<input type="text" class="txt " name="matche_platform" value="" placeholder="请输入对应平台">
</td>
@ -52,14 +52,14 @@
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->渠道费率:</td>
<td class="l">渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->开票税点:</td>
<td class="l">开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="invoice_rate" value="" placeholder="请输入开票税点"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
@ -68,58 +68,56 @@
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="l noticeinfo">是否签署合同:</td>
<td class="r">
<select name="is_sign_contract" class="select_gallery">
<option value="">请选择是否签署合同</option>
<option value="1" <if condition="$data['is_sign_contract'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['is_sign_contract'] eq '0'"> selected="selected"</if>>否</option>
<option value="1"></option>
<option value="0" selected="selected"></option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>结算方式:</td>
<td class="l noticeinfo">结算方式:</td>
<td class="r">
<select name="settlement_type" class="select_gallery">
<option value="0">请选择结算方式</option>
<option value="1" <if condition="$data['settlement_type'] eq '1'"> selected="selected"</if>>周结</option>
<option value="2" <if condition="$data['settlement_type'] eq '2'"> selected="selected"</if>>月结</option>
<option value="0" selected></option>
<option value="1">周结</option>
<option value="2">月结</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>公司性质:</td>
<td class="l noticeinfo">公司性质:</td>
<td class="r">
<select name="company_type" class="select_gallery">
<option value="0">请选择公司性质</option>
<option value="1" <if condition="$data['company_type'] eq '1'"> selected="selected"</if>>公司</option>
<option value="2" <if condition="$data['company_type'] eq '2'"> selected="selected"</if>>个人</option>
<!-- <option value="0">请选择公司性质</option> -->
<option value="1" selected>公司</option>
<option value="2">个人</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否有游戏资质:</td>
<td class="l noticeinfo">是否有游戏资质:</td>
<td class="r">
<select name="has_game_evidence" class="select_gallery">
<option value="">请选择是否有游戏资质</option>
<option value="1" <if condition="$data['has_game_evidence'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['has_game_evidence'] eq '0'"> selected="selected"</if>>否</option>
<option value="1"></option>
<option value="0" selected="selected"></option>
</select>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系人:</td>
<td class="l">联系人:</td>
<td class="r" >
<input type="text" class="txt " name="link_man" value="" placeholder="请输入联系人">
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系电话:</td>
<td class="l">联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="" placeholder="请输入联系电话">
</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->对应平台(简称)</td>
<td class="l">对应平台(简称)</td>
<td class="r" >
<input type="text" class="txt " name="matche_platform" value="{$data.matche_platform}" placeholder="请输入对应平台">
</td>
@ -52,14 +52,14 @@
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->渠道费率:</td>
<td class="l">渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="{$data.channel_rate}" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->开票税点:</td>
<td class="l">开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="invoice_rate" value="{$data.invoice_rate}" placeholder="请输入开票税点"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
@ -68,10 +68,10 @@
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="l noticeinfo">是否签署合同:</td>
<td class="r">
<select name="is_sign_contract" class="select_gallery">
<option value="">请选择是否签署合同</option>
<!-- <option value="">请选择是否签署合同</option> -->
<option value="1" <if condition="$data['is_sign_contract'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['is_sign_contract'] eq '0'"> selected="selected"</if>>否</option>
</select>
@ -79,10 +79,10 @@
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>结算方式:</td>
<td class="l noticeinfo">结算方式:</td>
<td class="r">
<select name="settlement_type" class="select_gallery">
<option value="0">请选择结算方式</option>
<option value="0" <if condition="$data['settlement_type'] eq '0'"> selected="selected"</if>>无</option>
<option value="1" <if condition="$data['settlement_type'] eq '1'"> selected="selected"</if>>周结</option>
<option value="2" <if condition="$data['settlement_type'] eq '2'"> selected="selected"</if>>月结</option>
</select>
@ -90,10 +90,9 @@
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>公司性质:</td>
<td class="l noticeinfo">公司性质:</td>
<td class="r">
<select name="company_type" class="select_gallery">
<option value="0">请选择公司性质</option>
<option value="1" <if condition="$data['company_type'] eq '1'"> selected="selected"</if>>公司</option>
<option value="2" <if condition="$data['company_type'] eq '2'"> selected="selected"</if>>个人</option>
</select>
@ -101,10 +100,10 @@
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否有游戏资质:</td>
<td class="l noticeinfo">是否有游戏资质:</td>
<td class="r">
<select name="has_game_evidence" class="select_gallery">
<option value="">请选择是否有游戏资质</option>
<!-- <option value="">请选择是否有游戏资质</option> -->
<option value="1" <if condition="$data['has_game_evidence'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['has_game_evidence'] eq '0'"> selected="selected"</if>>否</option>
</select>
@ -112,14 +111,14 @@
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系人:</td>
<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"><i class="mustmark" style="margin-left:-7px">*</i>联系电话:</td>
<td class="l">联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="{$data.link_phone}" placeholder="请输入联系电话">
</td>

Loading…
Cancel
Save