From 9d041f7c8a1f96a8c5ff8a6b33a76ac1cd36c22f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 25 Aug 2020 14:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/SafeController.class.php | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index 07ec33d96..347081631 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -177,17 +177,16 @@ class SafeController extends BaseController{ //修改用户信息 public function modifyBaseInfo() { - $id = get_pid(); - $safePwd = M('promote','tab_')->where(['id'=>$id])->field('second_pwd')->find(); - if(empty($safePwd['second_pwd'])) { + $loginPromote = $this->getLoginPromote(); + $id = $loginPromote['id']; + if(empty($loginPromote['second_pwd'])) { $this->display('Public/setSafePwd'); exit; } $metaTitle = '基础信息'; $modelList = ['基础信息', $metaTitle]; $this->verifyPasswordView($modelList); - $ver_status = M('promote','tab_')->where(['id'=>$id])->getField('ver_status',true); - if($ver_status[0] == 1) { + if($loginPromote['ver_status'] == 1) { //return $this->display('editModify'); $this->redirect('editModify'); exit; @@ -265,12 +264,12 @@ class SafeController extends BaseController{ return false; } if(empty($bank_account)) { - $this->error("银行户名不能为空"); + $this->error("银行账户名不能为空"); return false; } $bank_account_pattern = "/^[\x{4e00}-\x{9fa5}]{2,}$/u"; if (!preg_match($bank_account_pattern, $bank_account)) { - $this->error('银行卡开户人姓名错误'); + $this->error('银行账户名格式错误'); return false; } if(empty($bank_card)) { @@ -323,6 +322,14 @@ class SafeController extends BaseController{ $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); if($updateRs) { + + if ($loginPromote['level'] == 1 && $loginPromote['company_id'] > 0 && $loginPromote['withdraw_done'] == 1) { + M('promote_company', 'tab_')->where(['id' => $loginPromote['company_id']])->update([ + 'alipay_account' => $alipayaccount, + 'ali_user' => $alipayrealname, + ]); + } + recordPromoteLogs('安全管理','修改用户信息'); $this->success("更新信息成功"); }else { @@ -330,8 +337,7 @@ class SafeController extends BaseController{ } - }else { - $id = get_PID(); + } else { $result = M("promote","tab_")->where(['id'=>$id])->select(); $promoteInfo = $result[0]; $idcarpic = $promoteInfo['idcarpic']; @@ -383,8 +389,6 @@ class SafeController extends BaseController{ $this->assign("promoteCompany",$promoteCompany); $this->assign("ver_status",$promoteInfo['ver_status']); $this->assign('promoteinfo', $promoteInfo); - - } $this->display(); } @@ -407,6 +411,7 @@ class SafeController extends BaseController{ } public function edit() { + $loginPromote = $this->getLoginPromote(); $id = get_pid(); $tel = $_REQUEST["tel"]; $address1 = $_REQUEST["address"]; @@ -522,12 +527,20 @@ class SafeController extends BaseController{ $agreementpic ? $data['anothpic'] = $agreementpic : null; $id = get_pid(); $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); - if($updateRs) { - recordPromoteLogs('安全管理','二次修改信息'); - $this->success("更新信息成功",U('modifyBaseInfo')); - }else { - $this->error("更新信息失败"); + if($updateRs) { + + if ($loginPromote['level'] == 1 && $loginPromote['company_id'] > 0 && $loginPromote['withdraw_done'] == 1) { + M('promote_company', 'tab_')->where(['id' => $loginPromote['company_id']])->update([ + 'alipay_account' => $alipayaccount, + 'ali_user' => $alipayrealname, + ]); } + + recordPromoteLogs('安全管理','二次修改信息'); + $this->success("更新信息成功",U('modifyBaseInfo')); + }else { + $this->error("更新信息失败"); + } } public function ajaxEdit() {