master
ELF 4 years ago
parent 6e2fda1e26
commit 6596e01a29

@ -603,11 +603,18 @@ class PromoteCompanyController extends ThinkController
$this->checkData($save);
$promoteCompanyService = new PromoteCompanyService();
$oldData = M('promote_company', 'tab_')->field(['id', 'company_belong'])->where(['id' => $save['company_id']])->find();
$isNewDeposit = false;
if (!in_array($oldData['company_belong'], [1, 2]) && in_array($save['company_belong'], [1, 2])) {
$isNewDeposit = true;
}
try {
/* $presidentDepositService = new PresidentDepositService();
if (in_array($save['company_belong'], [1, 2])) {
$presidentDepositService = new PresidentDepositService();
if ($isNewDeposit && in_array($save['company_belong'], [1, 2])) {
$presidentDepositService->checkBeforeSave($save['deposit'] ?? []);
} */
}
$promoteCompanyService->checkPromotes($save['promotes'] ?? []);
$promoteCompanyService->checkCompanyRelation($save['relation'] ?? []);
} catch (\Exception $e) {

@ -166,7 +166,7 @@
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>团体归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_belong" name="company_belong" class="select_gallery" style="width: 215px;">
<select id="company_belong" name="company_belong" class="select_gallery" style="width: 215px;" data-old="<?=$data['company_belong']?>">
<!-- <option value="">请选择团体归属</option> -->
<volist name=":getCompanyBlong()" id="vo">
<option value="{$vo.id}" <php> if($data['company_belong'] !='' && $vo['id'] == $data['company_belong'])echo selected;</php>>{$vo.name}</option>
@ -998,11 +998,19 @@
$('#company_belong').change(function () {
var val = $(this).val()
var old = $(this).attr('data-old')
if (val != 1 && val != 2) {
$('.deposit-item').addClass('no-deposit')
} else {
$('.deposit-item').removeClass('no-deposit')
}
if ((old != 1 && old != 2) && (val == 1 || val == 2)) {
$('#deposit-pay-type').removeAttr('disabled')
$('#deposit-pay-way').removeAttr('disabled')
$('#deposit-payer').removeAttr('readonly')
$('#deposit-amount').removeAttr('readonly')
$('#deposit-pay-account').removeAttr('readonly')
}
})
$('#deposit-pay-type').change(function() {

@ -39,6 +39,7 @@
<th>开发类型</th>
<th>公司性质</th>
<th>结算周期</th>
<th>押金</th>
<th>会长账号</th>
<th>市场专员</th>
@ -91,10 +92,11 @@
<td rowspan="{$data.row}">{$data.company_type}</td>
<td rowspan="{$data.row}">{$data.settlement_type}</td>
<td rowspan="{$data.row}">{$data.deposit_pay_type}</td>
<notempty name="data.list">
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['account']|default="--"}</td>
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['market_admin_username']|default="--"}</td>
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['pay_type']|default="--"}</td>
<!-- <td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['pay_type']|default="--"}</td> -->
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['amount']|default="--"}</td>
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['status']|default="--"}</td>
@ -229,7 +231,7 @@
<tr>
<td rowspan="{$promote['row']}">{$promote['account']|default="--"}</td>
<td rowspan="{$promote['row']}">{$promote['market_admin_username']|default="--"}</td>
<td rowspan="{$promote['row']}">{$promote['pay_type']|default="--"}</td>
<!-- <td rowspan="{$promote['row']}">{$promote['pay_type']|default="--"}</td> -->
<td rowspan="{$promote['row']}">{$promote['amount']|default="--"}</td>
<td rowspan="{$promote['row']}">{$promote['status']|default="--"}</td>

@ -282,7 +282,7 @@
<tr>
<td rowspan="{$promote['row']}">{$promote['account']|default="--"}</td>
<td rowspan="{$promote['row']}">{$promote['market_admin_username']|default="--"}</td>
<td rowspan="{$promote['row']}">{$promote['pay_type']|default="--"}</td>
<!-- <td rowspan="{$promote['row']}">{$promote['pay_type']|default="--"}</td> -->
<notempty name="promote['list']">
<td rowspan="{$promote['list'][0]['row']}">{$promote['list'][0]['original_package_name']|default="--"}</td>

@ -171,20 +171,26 @@ class PromoteCompanyService
unset($companyInfo['relation']);
unset($companyInfo['promotes']);
$isNew = false;
$isNewDeposit = false;
if($application['company_id'] == 0){
//新增
$isNew = true;
$isNewDeposit = true;
$application['company_id'] = $companyInfo['id'] = M('promote_company', 'tab_')->add($companyInfo);
}else{
//编辑
$oldInfo = M('promote_company', 'tab_')->field(['id', 'company_belong'])->where(['id' => $application['company_id']])->find();
/** 内团/无 切换为外团 */
if (in_array($companyInfo['company_belong'], [1, 2]) && !in_array($oldInfo['company_belong'], [1, 2])) {
$isNewDeposit = true;
}
M('promote_company', 'tab_')->save($companyInfo);
$this->changePromote($companyInfo);
}
$this->savePromoteCompanyRelation($bindRelation, $companyInfo);
$this->savePromotes($promotes, $companyInfo, $creator);
if ($isNew && in_array($companyInfo['company_belong'], [1, 2])) {
if ($isNewDeposit && in_array($companyInfo['company_belong'], [1, 2])) {
$depositService = new PresidentDepositService();
$depositService->save($deposit, $companyInfo);
}

Loading…
Cancel
Save