master
ELF 4 years ago
parent e441f030c0
commit 9d041f7c8a

@ -177,17 +177,16 @@ class SafeController extends BaseController{
//修改用户信息 //修改用户信息
public function modifyBaseInfo() { public function modifyBaseInfo() {
$id = get_pid(); $loginPromote = $this->getLoginPromote();
$safePwd = M('promote','tab_')->where(['id'=>$id])->field('second_pwd')->find(); $id = $loginPromote['id'];
if(empty($safePwd['second_pwd'])) { if(empty($loginPromote['second_pwd'])) {
$this->display('Public/setSafePwd'); $this->display('Public/setSafePwd');
exit; exit;
} }
$metaTitle = '基础信息'; $metaTitle = '基础信息';
$modelList = ['基础信息', $metaTitle]; $modelList = ['基础信息', $metaTitle];
$this->verifyPasswordView($modelList); $this->verifyPasswordView($modelList);
$ver_status = M('promote','tab_')->where(['id'=>$id])->getField('ver_status',true); if($loginPromote['ver_status'] == 1) {
if($ver_status[0] == 1) {
//return $this->display('editModify'); //return $this->display('editModify');
$this->redirect('editModify'); $this->redirect('editModify');
exit; exit;
@ -265,12 +264,12 @@ class SafeController extends BaseController{
return false; return false;
} }
if(empty($bank_account)) { if(empty($bank_account)) {
$this->error("银行户名不能为空"); $this->error("银行户名不能为空");
return false; return false;
} }
$bank_account_pattern = "/^[\x{4e00}-\x{9fa5}]{2,}$/u"; $bank_account_pattern = "/^[\x{4e00}-\x{9fa5}]{2,}$/u";
if (!preg_match($bank_account_pattern, $bank_account)) { if (!preg_match($bank_account_pattern, $bank_account)) {
$this->error('银行卡开户人姓名错误'); $this->error('银行账户名格式错误');
return false; return false;
} }
if(empty($bank_card)) { if(empty($bank_card)) {
@ -323,6 +322,14 @@ class SafeController extends BaseController{
$updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data);
if($updateRs) { 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('安全管理','修改用户信息'); recordPromoteLogs('安全管理','修改用户信息');
$this->success("更新信息成功"); $this->success("更新信息成功");
}else { }else {
@ -330,8 +337,7 @@ class SafeController extends BaseController{
} }
}else { } else {
$id = get_PID();
$result = M("promote","tab_")->where(['id'=>$id])->select(); $result = M("promote","tab_")->where(['id'=>$id])->select();
$promoteInfo = $result[0]; $promoteInfo = $result[0];
$idcarpic = $promoteInfo['idcarpic']; $idcarpic = $promoteInfo['idcarpic'];
@ -383,8 +389,6 @@ class SafeController extends BaseController{
$this->assign("promoteCompany",$promoteCompany); $this->assign("promoteCompany",$promoteCompany);
$this->assign("ver_status",$promoteInfo['ver_status']); $this->assign("ver_status",$promoteInfo['ver_status']);
$this->assign('promoteinfo', $promoteInfo); $this->assign('promoteinfo', $promoteInfo);
} }
$this->display(); $this->display();
} }
@ -407,6 +411,7 @@ class SafeController extends BaseController{
} }
public function edit() { public function edit() {
$loginPromote = $this->getLoginPromote();
$id = get_pid(); $id = get_pid();
$tel = $_REQUEST["tel"]; $tel = $_REQUEST["tel"];
$address1 = $_REQUEST["address"]; $address1 = $_REQUEST["address"];
@ -522,12 +527,20 @@ class SafeController extends BaseController{
$agreementpic ? $data['anothpic'] = $agreementpic : null; $agreementpic ? $data['anothpic'] = $agreementpic : null;
$id = get_pid(); $id = get_pid();
$updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data);
if($updateRs) { if($updateRs) {
recordPromoteLogs('安全管理','二次修改信息');
$this->success("更新信息成功",U('modifyBaseInfo')); if ($loginPromote['level'] == 1 && $loginPromote['company_id'] > 0 && $loginPromote['withdraw_done'] == 1) {
}else { M('promote_company', 'tab_')->where(['id' => $loginPromote['company_id']])->update([
$this->error("更新信息失败"); 'alipay_account' => $alipayaccount,
'ali_user' => $alipayrealname,
]);
} }
recordPromoteLogs('安全管理','二次修改信息');
$this->success("更新信息成功",U('modifyBaseInfo'));
}else {
$this->error("更新信息失败");
}
} }
public function ajaxEdit() { public function ajaxEdit() {

Loading…
Cancel
Save