master
ELF 4 years ago
parent e9038d7471
commit e441f030c0

@ -307,7 +307,7 @@ class PromoteCompanyController extends ThinkController
public function marketAgree(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log,company_info")->where("id in ({$ids})")->select();
$service = new PromoteCompanyService();
foreach($dbres as $k=>$v){
@ -332,6 +332,7 @@ class PromoteCompanyController extends ThinkController
"info"=>"市场部审核通过成功"
));
}
public function marketRefuse(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
@ -440,6 +441,7 @@ class PromoteCompanyController extends ThinkController
$this->display();
}
}
//查看
public function view()
{
@ -597,11 +599,11 @@ class PromoteCompanyController extends ThinkController
$this->checkData($save);
try {
$presidentDepositService = new PresidentDepositService();
$promoteCompanyService = new PromoteCompanyService();
/* $presidentDepositService = new PresidentDepositService();
if (in_array($save['company_belong'], [1, 2])) {
$presidentDepositService->checkBeforeSave($save['deposit'] ?? []);
}
} */
$promoteCompanyService = new PromoteCompanyService();
$promoteCompanyService->checkPromotes($save['promotes'] ?? []);
$promoteCompanyService->checkCompanyRelation($save['relation'] ?? []);
} catch (\Exception $e) {

@ -240,7 +240,7 @@
<tr class="deposit-item <?php if(!$needDeposit):?>no-deposit<?php endif;?>">
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>押金付款方式:</td>
<td class="r">
<select name="deposit[pay_type]" id="deposit-pay-type" class="select_gallery">
<select name="deposit[pay_type]" id="deposit-pay-type" class="select_gallery" disabled>
<option value="">押金付款方式</option>
<?php foreach($payTypes as $key => $name):?>
<option value="<?=$key?>" <?php if($deposit && $deposit['pay_type'] == $key):?>selected<?php endif;?>><?=$name?></option>
@ -252,7 +252,7 @@
<tr class="deposit-item <?php if(!$needDeposit):?>no-deposit<?php endif;?> need-amount">
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>押金支付方式:</td>
<td class="r">
<select name="deposit[pay_way]" id="deposit-pay-way" class="select_gallery">
<select name="deposit[pay_way]" id="deposit-pay-way" class="select_gallery" disabled>
<option value="">押金支付方式</option>
<?php foreach($payWays as $key => $name):?>
<option value="<?=$key?>" <?php if($deposit && $deposit['pay_way'] == $key):?>selected<?php endif;?>><?=$name?></option>
@ -264,21 +264,21 @@
<tr class="deposit-item <?php if(!$needDeposit):?>no-deposit<?php endif;?> need-amount">
<td class="l"><?php if($deposit):?><i class="mustmark">*</i><?php endif?>押金金额:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="deposit[amount]" id="deposit-amount" value="<?=$deposit?$deposit['amount']:''?>" placeholder="请输入押金金额">
<input type="text" class="txt ratio" name="deposit[amount]" id="deposit-amount" value="<?=$deposit?$deposit['amount']:''?>" placeholder="请输入押金金额" readonly>
<span class="notice-text"></span>
</td>
</tr>
<tr class="deposit-item <?php if(!$needDeposit):?>no-deposit<?php endif;?> need-amount">
<td class="l">押金付款人:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="deposit[payer]" id="deposit-payer" value="<?=$deposit?$deposit['payer']:''?>" placeholder="请输入押金付款人">
<input type="text" class="txt ratio" name="deposit[payer]" id="deposit-payer" value="<?=$deposit?$deposit['payer']:''?>" placeholder="请输入押金付款人" readonly>
<span class="notice-text"></span>
</td>
</tr>
<tr class="deposit-item <?php if(!$needDeposit):?>no-deposit<?php endif;?> need-amount">
<td class="l">押金付款账号:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="deposit[pay_account]" id="deposit-pay-account" value="<?=$deposit?$deposit['pay_account']:''?>" placeholder="请输入押金付款账号">
<input type="text" class="txt ratio" name="deposit[pay_account]" id="deposit-pay-account" value="<?=$deposit?$deposit['pay_account']:''?>" placeholder="请输入押金付款账号" readonly>
<span class="notice-text"></span>
</td>
</tr>
@ -1021,7 +1021,9 @@
$('#deposit-pay-way').val('')
}
})
$('#deposit-pay-type').change()
if ($('#deposit-pay-type').val() == 3) {
$('.need-amount').hide();
}
// $('#deposit-pay-type').change()
</script>
</block>

@ -64,6 +64,9 @@ class PresidentDepositService
public function save($params, $company = null)
{
if (empty($params)) {
throw new \Exception('参数不能为空');
}
$companyId = $params['company_id'] ?? 0;
$payWay = $params['pay_way'] ?? 0;
$payType = $params['pay_type'] ?? 0;

@ -159,25 +159,30 @@ class PromoteCompanyService
$application['verify_status'] = 2;
$companyInfo = json_decode($application['company_info'], true);
$deposit = $companyInfo['deposit'];
$deposit = null;
$bindRelation = $companyInfo['relation'];
$promotes = $companyInfo['promotes'];
unset($companyInfo['deposit']);
if (isset($companyInfo['deposit'])) {
$deposit = $companyInfo['deposit'];
unset($companyInfo['deposit']);
}
unset($companyInfo['relation']);
unset($companyInfo['promotes']);
$isUpdate = false;
if($application['company_id'] == 0){
//新增
$application['company_id'] = $companyInfo['id'] = M('promote_company', 'tab_')->add($companyInfo);
}else{
//编辑
$isUpdate = true;
M('promote_company', 'tab_')->save($companyInfo);
$this->changePromote($companyInfo);
}
$this->savePromoteCompanyRelation($bindRelation, $companyInfo);
$this->savePromotes($promotes, $companyInfo);
if (in_array($companyInfo['company_belong'], [1, 2])) {
if ($isUpdate && in_array($companyInfo['company_belong'], [1, 2])) {
$depositService = new PresidentDepositService();
$depositService->save($deposit, $companyInfo);
}

Loading…
Cancel
Save