From 1bd33daa5496625227fbb67c4df11630b09d6910 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 21 Jul 2020 10:31:58 +0800 Subject: [PATCH] upt --- .../Home/Controller/SafeController.class.php | 94 +++- .../Home/View/default/Safe/editModify.html | 497 +++++++++++------- Data/update.sql | 3 + 3 files changed, 400 insertions(+), 194 deletions(-) diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index aa37c1988..f2b352e2f 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -112,6 +112,16 @@ class SafeController extends BaseController{ $this->display(); } + + public function ajaxVerifyCode($phone, $code) + { + return $this->success('验证成功'); + if (!$this->checksafecode($phone, $code)) { + return $this->error('验证码错误'); + } else { + return $this->success('验证成功'); + } + } public function verifySafePwd() { @@ -200,6 +210,8 @@ class SafeController extends BaseController{ $idcarpic = $_REQUEST['idcarpic']; $businesspic = $_REQUEST['businesspic']; $agreementpic = $_REQUEST['agreementpic']; + $alipayaccount = $_REQUEST['alipay_account']; + $alipayrealname = $_REQUEST['aplipay_real_name']; if(empty($_REQUEST['agree'])) { $this->error("请先认真阅读协议,然后勾选协议"); return false; @@ -276,6 +288,24 @@ class SafeController extends BaseController{ $this->error('卡号格式错误'); return false; } + if (empty($alipayaccount)) { + $this->error('支付宝账户不能为空'); + return false; + } + // TODO::验证支付宝的账户格式 + if (!preg_match("/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/", $alipayaccount)) { + $this->error('支付宝账户错误'); + return false; + } + + if (empty($alipayrealname)) { + $this->error('支付宝真实姓名不能为空'); + return false; + } + if (!preg_match($bank_account_pattern, $alipayrealname)) { + $this->error('支付宝真实姓名错误'); + return false; + } $data["real_name"] = $username; $data['mobile_phone'] = $tel; $data['idcard'] = $id_card; @@ -289,6 +319,7 @@ class SafeController extends BaseController{ $data['businesspic'] = $businesspic; $data['agreementpic'] = $agreementpic; $data['ver_status'] = 3; + dd($data); if($account_type == "公司") { $data['account_type'] = 1; }else { @@ -365,10 +396,10 @@ class SafeController extends BaseController{ public function editModify() { $id = get_pid(); - $rs = M("promote","tab_")->field('anothpic,ver_status,real_name,bank_card,mobile_phone,email,address,idcard')->where(['id'=>$id])->find(); + $rs = M("promote","tab_")->field('anothpic,ver_status,real_name,bank_name,bank_card,bank_account,mobile_phone,email,address,idcard,alipay_account,alipay_real_name')->where(['id'=>$id])->find(); $anothpic = $rs['anothpic']; $promoteInfo = ""; - $address = json_decode($rs['address'],false)[1]; + $address = json_decode($rs['address'],true); $realname = mb_strlen($rs['real_name'],'utf-8') == 2 ? mb_substr($rs['real_name'],0,1,'utf-8').'*':mb_substr($rs['real_name'],0,1,'utf-8').'**'; $this->assign('addr',$address); $this->assign('ver_status',$rs['ver_status']); @@ -385,9 +416,14 @@ class SafeController extends BaseController{ $tel = $_REQUEST["tel"]; $address1 = $_REQUEST["address"]; $email = $_REQUEST["email"]; - $account_type = $_REQUEST["account_type"]; - $bank = $_REQUEST["bank"]; + //$account_type = $_REQUEST["account_type"]; + $bank = $_REQUEST["bank_card"]; //银行账号 + $bank_name = $_REQUEST["bank_name"]; //开户银行 + $bank_account = $_REQUEST['bank_account']; //银行账户名 $agreementpic = $_REQUEST["agreementpic"]; + $alipayaccount = $_REQUEST['alipay_account']; + $alipayrealname = $_REQUEST['alipay_real_name']; + if(empty($tel)) { $this->error("手机号码不能为空"); return false; @@ -397,7 +433,7 @@ class SafeController extends BaseController{ $this->error("手机号码格式不合法"); return false; } - $telInfo = M('promote','tab_')->field('id')->where(['mobile_phone'=>$tel])->find(); + $telInfo = M('promote','tab_')->field('id')->where(['mobile_phone'=>$tel, 'id'=>['neq'=>get_pid()]])->find(); if(!empty($telInfo)) { $this->error("手机号码已存在"); return false; @@ -411,6 +447,19 @@ class SafeController extends BaseController{ $this->error("邮箱不能为空"); return false; } + if(empty($bank_name)) { + $this->error("开户银行不能为空"); + return false; + } + if(empty($bank_account)) { + $this->error("银行户名不能为空"); + return false; + } + $bank_account_pattern = "/^[\x{4e00}-\x{9fa5}]{2,}$/u"; + if (!preg_match($bank_account_pattern, $bank_account)) { + $this->error('银行卡开户人姓名错误'); + return false; + } $patternemail = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i"; if (!preg_match($patternemail, $email)) { $this->error('邮箱地址错误'); @@ -429,15 +478,38 @@ class SafeController extends BaseController{ $this->error("补充协议不能为空"); return false; } + if (empty($alipayaccount)) { + $this->error('支付宝账户不能为空'); + return false; + } + // TODO::验证支付宝的账户格式 + if (!preg_match("/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/", $alipayaccount)) { + $this->error('支付宝账户错误'); + return false; + } + + if (empty($alipayrealname)) { + $this->error('支付宝真实姓名不能为空'); + return false; + } + if (!preg_match($bank_account_pattern, $alipayrealname)) { + $this->error('支付宝真实姓名错误'); + return false; + } $Res = M("promote","tab_")->field('address')->where(['id'=>$id])->find(); - $address = json_decode($Res['address'],false); + $address = json_decode($Res['address'],true); $address[1] = $address1; $data['mobile_phone'] = $tel; $data['address'] = json_encode($address,TRUE); $data['email'] = $email; - $data['account_type'] = $account_type; + //$data['account_type'] = $account_type; $data['bank_card'] = $bank; + $data['bank_name'] = $bank_name; + $data['bank_account'] = $bank_account; $data['ver_status'] = 4; + $data['alipay_account'] = $alipayaccount; + $data['alipay_real_name'] = $alipayrealname; + // $data['agreementpic'] = $ $data['anothpic'] = $agreementpic; $id = get_pid(); @@ -452,7 +524,7 @@ class SafeController extends BaseController{ public function ajaxEdit() { $id = get_pid(); - $rs = M("promote","tab_")->field('mobile_phone,address,email,account_type,bank_card,anothpic')->where(['id'=>$id])->find(); + $rs = M("promote","tab_")->field('mobile_phone,address,email,account_type,bank_name,bank_card,bank_account,anothpic,alipay_account,alipay_real_name')->where(['id'=>$id])->find(); $this->assign('tel',$rs['mobile_phone']); $this->assign('address',$rs['address']); $this->assign('email',$rs['email']); @@ -460,12 +532,16 @@ class SafeController extends BaseController{ $this->assign('bank_card',$rs['bank_card']); $res = [ 'tel'=> $rs['mobile_phone'], - 'address'=> json_decode($rs['address'],false)[1], + 'address'=> json_decode($rs['address'],true)[1], 'email'=> $rs['email'], 'account_type'=> $rs['account_type'], 'bank_card'=> $rs['bank_card'], + 'bank_name'=> $rs['bank_name'], + 'bank_account'=> $rs['bank_account'], 'idcarpic' => $rs['idcarpic'], 'anothpic' => $rs['anothpic'], + 'alipay_account' => $rs['alipay_account'], + 'alipay_real_name' => $rs['alipay_real_name'], ]; if($rs['account_type'] == 1) { $res['complanystatus'] = true; diff --git a/Application/Home/View/default/Safe/editModify.html b/Application/Home/View/default/Safe/editModify.html index 34fd06d37..4dc272578 100644 --- a/Application/Home/View/default/Safe/editModify.html +++ b/Application/Home/View/default/Safe/editModify.html @@ -144,7 +144,7 @@ 电话: {$tel}
- 联系地址: {$addr} + 联系地址:     {$item}
邮箱: {$rs['email']} @@ -153,10 +153,20 @@ 账户类型: 已认证
- 开户银行: {$rs['bank_card']}       - 修改 + 开户银行: {$rs['bank_name']}       +
+
+ 支付宝真实姓名: {$rs['alipay_real_name']} +
+
+ 支付宝账户: {$rs['alipay_account']}
+
+
+ +
+
@@ -167,6 +177,8 @@ diff --git a/Data/update.sql b/Data/update.sql index aa6d436fe..69d4b84e8 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2165,4 +2165,7 @@ CREATE TABLE `tab_payment_member` ( INSERT INTO `tab_payment_member` (`id`, `real_name`, `mobile`, `last_login_time`) VALUES ('1', '胡歌', '18959188422', '0') +---- 2020-7-20 ylw +ALTER TABLE `tab_promote` +ADD COLUMN `alipay_real_name` varchar(30) NOT NULL DEFAULT '' COMMENT '支付宝真实姓名' AFTER `alipay_account`;