Merge branch 'feature/promote_base_info' of wmtx/platform into release

推广员个人信息
master
廖金灵 5 years ago committed by Gogs
commit 5bf4e4af67

@ -113,6 +113,15 @@ class SafeController extends BaseController{
$this->display();
}
public function ajaxVerifyCode($phone, $code)
{
if (!$this->checksafecode($phone, $code)) {
return $this->error('验证码错误');
} else {
return $this->success('验证成功');
}
}
public function verifySafePwd() {
if($_POST) {
@ -200,6 +209,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 +287,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 +318,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 +395,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,19 +415,37 @@ 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;
}
// 判断是否验证过手机号
// 获取最后一次验证的手机
// $lastVerified = M('sms_logs', 'tab_')->where(['mobile'=>$tel])->order('id desc')->find();
// if ($lastVerified['is_checked'] != 1) // 判断是否失效, 有效时间2分钟
// {
// $this->error("尚未验证过短信或者短信验证已失效,请重新验证");
// return false;
// } else if (time()-strtotime($lastVerified['created_at']) > 120) {
// $this->error("短信验证已失效,请重新验证");
// return false;
// }
$pattern = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($pattern, $tel)) {
$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 +459,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 +490,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 +536,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,login_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 +544,17 @@ class SafeController extends BaseController{
$this->assign('bank_card',$rs['bank_card']);
$res = [
'tel'=> $rs['mobile_phone'],
'address'=> json_decode($rs['address'],false)[1],
'login_phone' => $rs['login_phone'],
'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;

@ -144,7 +144,7 @@
电话: {$tel}
</div>
<div class="line_text">
联系地址: {$addr}
联系地址: <?php foreach($addr as $item):?>&nbsp;&nbsp;&nbsp;&nbsp;{$item}<?php endforeach;?>
</div>
<div class="line_text">
邮箱: {$rs['email']}
@ -153,8 +153,18 @@
账户类型: <span style="color:#449acb">已认证<span>
</div>
<div class="line_text">
开户银行: {$rs['bank_card']} &nbsp; &nbsp; &nbsp;
<span onclick="ed(1)" id="edit" style="color:#449acb">修改</span>
开户银行: {$rs['bank_name']} &nbsp; &nbsp; &nbsp;
</div>
<div class="line_text">
支付宝真实姓名: {$rs['alipay_real_name']}
</div>
<div class="line_text">
支付宝账户: {$rs['alipay_account']}
</div>
</div>
<div style="margin-top: 30px;">
<div class="form-group normal_space">
<input type="submit" class="submit" onclick="ed(1)" value="修改">
</div>
</div>
</div>
@ -167,13 +177,117 @@
</script>
<script>
function ed(id) {
// 检查是否验证过手机号
$.ajax({
type:"POST",
url:"{:U('Safe/ajaxEdit')}",
data:{'id':id},
dataType:'json',
success:function(res) {
var tel = res.tel
var tel = login_phone = res.login_phone
if (!login_phone) {
layer.msg('请先绑定手机号后再来修改信息');
return ;
}
// TODO::判断是否需要验证
//获取短信
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: true
,area: ["700px","400px"]
,id: 'LAY_layui_smm' //设定一个id防止重复弹出
,content:`
<div class="page-list normal_list promote-base_info-form">
<div class="trunk-title">
<span class="title_main">手机号验证</span>
</div>
<div class="trunk-content article">
<div class="trunk-list baseInfo">
<form novalidate="novalidate" method="post" class="paw_info">
<table class="table2" style="margin-top:50px;margin-left:50px">
<tr>
<td class="l"><span style="color:red">*</span>登陆手机号码</td>
<td class="r">
<input type="text" readonly class="input txt" name="login_phone" id="login_phone" style="width:430px" value="`+tel+`">
<span id="confirm_password_tip"></span></td>
</tr>
<tr>
<td class="l"><span style="color:red">*</span>短信验证码</td>
<td class="r"><input type="text" class="input txt" name="code" id="code" style="width:230px" placeholder="请输入短信验证码">
<span id="confirm_password_tip"></span>
<button id="sendtelCode" class="tj btn" target-form="paw_info">发送验证码</button>
</td>
</tr>
<tr>
<td class="l"></td>
<td class="r">
<input type="submit" id="check-code-btn" class="tj btn ajax-post" value="保存" style="margin-top:40px;width:200px" title="" target-form="paw_info">
<input type="button" class="tj btn ajax-post" value="返回" onclick='window.location.href = "{:U('safe/editModify')}"' style="margin-top:40px;width:200px;margin-left:50px" title="" target-form="paw_info">
</td>
</tr>
</table>
</form>
</div>
</div>`
});
$('#sendtelCode').on('click',function() {
if ($(this).hasClass('g-btntn')) {
return false;
}
var phone = $.trim($('#login_phone').val());
if (phone == '') {
alert("手机号不能为空");
return false;
}
if (phone.length !== 11 || !(/^[1][35789][0-9]{9}$/.test(phone))) {
pmsg.msg("格式不正确");
return false;
}
$.ajax({
type:'post',
dataType:'json',
data:{'phone':phone, 'exceptExists':1},
url:'{:U("telsafecode")}',
success:function(data) {
if (data.status ==1) {
r(1);
} else {
alert(data.msg);
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
});
var r = function(i, t) {
var e = $('#sendtelCode');
var t = 60;
e.addClass('disabled').attr('disabled', true).text(t+'秒');
var a = setInterval(function() {
t--;
e.text(t+'秒');
t>0 || (clearInterval(a),e.removeClass('disabled').attr('disabled', false).text('重新发送'));
},1000);
};
return false;
});
$('#check-code-btn').on('click', function(){
$.ajax({
type:"POST",
url:"{:U('Safe/ajaxVerifyCode')}",
data:{'phone':tel, 'code':$('#code').val()},
dataType:'json',
success:function(verifyResponse){
if (verifyResponse.status == 0) {
layer.msg(verifyResponse.info);
} else { // 验证成功
layer.closeAll();
layer.msg('验证成功')
var address = res.address
console.log(res)
var email = res.email
@ -189,6 +303,8 @@
var complanystatus = res.complanystatus
var personalstatus = res.personalstatus
var anothpic = res.anothpic
var alipayAccount = res.alipay_account
var alipayRealName = res.alipay_real_name
layer.open({
type: 1
,title: false //不显示标题栏
@ -207,9 +323,17 @@
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">邮箱:</td><td class="r"><input type="text" class="input txt" name="email" id="confirm_password" style="width:430px" placeholder="" value="'+email+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">账户类型:</td><td class="r"><input type="radio" class="input txt" name="account_type" value="公司" '+complany+'>公司<input type="radio" class="input txt" style="margin-left:20px" name="account_type" value="个人" '+personal+'>个人'
// +' <tr><td class="l">账户类型:</td><td class="r"><input type="radio" class="input txt" name="account_type" value="公司" '+complany+'>公司<input type="radio" class="input txt" style="margin-left:20px" name="account_type" value="个人" '+personal+'>个人'
// +'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">开户银行:</td><td class="r"><input type="text" class="input txt" name="bank_name" id="confirm_password" style="width:430px" placeholder="" value="'+res.bank_name+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">开户银行:</td><td class="r"><input type="text" class="input txt" name="bank" id="confirm_password" style="width:430px" placeholder="" value="'+bank_card+'">'
+' <tr><td class="l">银行账户名:</td><td class="r"><input type="text" class="input txt" name="bank_account" id="bank_account" style="width:430px" placeholder="" value="'+res.bank_account+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">银行账号:</td><td class="r"><input type="text" class="input txt" name="bank_card" id="bank_card" style="width:430px" placeholder="" value="'+res.bank_card+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">支付宝真实姓名:</td><td class="r"><input type="text" class="input txt" name="alipay_real_name" id="alipay_real_name" style="width:430px" placeholder="" value="'+res.alipay_real_name+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr><td class="l">支付宝账户:</td><td class="r"><input type="text" class="input txt" name="alipay_account" id="alipay_account" style="width:430px" placeholder="" value="'+res.alipay_account+'">'
+'<span id="confirm_password_tip"></span></td></tr>'
+' <tr> <td class="l" style="margin-top:20px">补充协议:</td><td class="r">'
+' <input type="hidden" name="agreementpic" id="" value=""/>'
@ -221,8 +345,6 @@
+'<input type="button" id="btn" class="tj btn ajax-post" value="返回" style="margin-top:40px;width:200px;margin-left:50px" title="" target-form="paw_info"></td> </tr></table></form>'
+'</div></div></div>'
// ,content:content
})
$("#btn").click(function() {
window.location.href = "{:U('safe/editModify')}"
@ -368,10 +490,15 @@
$('input[name=agreementpic]').val(agreementpic);
}
}
}
});
return false;
})
}
})
}
</script>

@ -2237,6 +2237,9 @@ 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`;
--chenzhi
ALTER TABLE `tab_game`
ADD COLUMN `select_package_name` tinyint(2) NOT NULL DEFAULT 0 COMMENT '结算包名 0:原包名 1:现包名' AFTER `original_package_name`;

Loading…
Cancel
Save