diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 19288fd17..9ed3c517c 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -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) { diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 9d5d14aa1..a2afbe70d 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -166,7 +166,7 @@ *团体归属:
- @@ -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() { diff --git a/Application/Admin/View/PromoteCompany/export.html b/Application/Admin/View/PromoteCompany/export.html index 646f4e284..d3c6e1a7d 100644 --- a/Application/Admin/View/PromoteCompany/export.html +++ b/Application/Admin/View/PromoteCompany/export.html @@ -39,6 +39,7 @@ 开发类型 公司性质 结算周期 + 押金 会长账号 市场专员 @@ -91,10 +92,11 @@ {$data.company_type} {$data.settlement_type} + {$data.deposit_pay_type} {$data['list'][0]['account']|default="--"} {$data['list'][0]['market_admin_username']|default="--"} - {$data['list'][0]['pay_type']|default="--"} + {$data['list'][0]['amount']|default="--"} {$data['list'][0]['status']|default="--"} @@ -229,7 +231,7 @@ {$promote['account']|default="--"} {$promote['market_admin_username']|default="--"} - {$promote['pay_type']|default="--"} + {$promote['amount']|default="--"} {$promote['status']|default="--"} diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index 020c945c0..51b1c80d0 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -282,7 +282,7 @@ {$promote['account']|default="--"} {$promote['market_admin_username']|default="--"} - {$promote['pay_type']|default="--"} + {$promote['list'][0]['original_package_name']|default="--"} diff --git a/Application/Base/Service/PromoteCompanyService.class.php b/Application/Base/Service/PromoteCompanyService.class.php index aef938c45..04ee39297 100644 --- a/Application/Base/Service/PromoteCompanyService.class.php +++ b/Application/Base/Service/PromoteCompanyService.class.php @@ -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); }