推广员账号已存在判断

master
liuweiwen 5 years ago
parent 2b4c9b6f44
commit cc1e3ccbb3

@ -199,6 +199,16 @@ class PromoteController extends ThinkController
parent::lists('SiteApply', $p, $map);
}
private function accountExist($account, $id = null)
{
$res = M('promote', 'tab_')->where(['account' => $account])->field('id')->find();
if ($res) {
return $id != $res['id'];
} else {
return false;
}
}
public function add($account=null, $password=null, $second_pwd=null, $real_name=null, $email=null,
$mobile_phone=null, $bank_name=null, $bank_card=null, $admin=null, $status=null, $ba_id = null, $company_id = null)
{
@ -206,6 +216,9 @@ class PromoteController extends ThinkController
if (C('PROMOTE_AUTO_AUDIT') == 1) {
$status = 1;
}
if ($this->accountExist($account)) {
$this->error('该账号已存在');
}
$data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,
'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,
'admin_id'=>session('user_auth')['uid'],'status'=>$status,'ba_id'=>$ba_id, 'company_id' => $company_id);
@ -264,7 +277,9 @@ class PromoteController extends ThinkController
$data['account'] = I('post.account');
$map1['id'] = array('neq',$_POST['id']);
$map1['account'] = $data['account'];
if ($this->accountExist($data['account'])) {
$this->error('该账号已存在');
}
$pdata = D('Promote')->where($map1)->find();
if ($pdata) {

@ -10,7 +10,7 @@
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<block name="css"></block>
<link rel="stylesheet" type="text/css" href="__CSS__/{$Think.config.COLOR_STYLE}.css" media="all">
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
<![endif]--><!--[if gte IE 9]><!-->
@ -77,7 +77,7 @@
</div>
</div>
</div>
<!--下拉样式-->
<script type="text/javascript">
$(function(){
@ -89,23 +89,23 @@ $(function(){
}else{
ul.slideUp();
}
});
});
$('.jscbtn').click(function() {
$(this).siblings().slideToggle(200);
$(this).siblings().slideToggle(200);
return false;
});
$('.jssetcolor').click(function() {
var that = $(this),value=that.attr('data-value');
var par = that.closest('.jssubjectlist');
if (that.hasClass('disabled')) {return false;}
$('.jssetcolor').addClass('disabled');
$.post('{:U("Admin/set_color_style")}',{value:value},function(data) {
if (data.status==1) {
updateAlert(data.info,'tip_right');
@ -113,7 +113,7 @@ $(function(){
$('#tip').find('.tipclose').click();
setTimeout(function(){location.reload();},300);
},1500);
} else {
updateAlert(data.info,'tip_error');
setTimeout(function(){
@ -123,13 +123,13 @@ $(function(){
$('.jssetcolor').removeClass('disabled');
}
},'json');
return false;
});
})
</script>
<div id="tip" class="tip"><a class="tipclose hidden" ></a><div class="tipmain"><div class="tipicon"></div><div class="tipinfo">这是内容</div></div></div>
@ -138,7 +138,7 @@ $(function(){
var content = $('#main');
var top_alert = $('#tip');
//$('body').append('<div class="notice"><div><i></i>成功</div></div>');
top_alert.find('.tipclose').on('click', function () {
top_alert.removeClass('block').slideUp(200);
// content.animate({paddingTop:'-=55'},200);
@ -155,7 +155,7 @@ $(function(){
}
});
})
$('.new li:eq(1)').click(function(){
$.ajax({
type: 'POST',
@ -204,7 +204,7 @@ $(function(){
</div>
<div class="fgx">功能菜单</div>
<!-- 子导航 -->
<block name="sidebar">
<div id="subnav" class="subnav">
@ -255,7 +255,7 @@ $(function(){
<!-- nav -->
</block>
<if condition="CONTROLLER_NAME neq 'Index' ">
</if>
<block name="body"> </block>
</div>
@ -315,11 +315,11 @@ $(function(){
$this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
prev("h3").addClass('no').find("i").addClass("icon-fold").end().end().hide();
});*/
$("#subnav").on("click", "h3", function(event){
var e = event || window.event;
var target = $(e.target);
var $this = $(this);
var $this = $(this);
if ($this.index() == target.index())
$this.find(".icon").toggleClass("icon-fold");
else
@ -327,7 +327,7 @@ $(function(){
$this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
prev("h3").find("i").addClass("icon-fold").end().end().hide();
});
$("#subnav h3 a").click(function(e){e.stopPropagation()});

Loading…
Cancel
Save