예제 #1
0
 public function register()
 {
     $arr = $this->sign;
     if (!self::isMobile($arr['phone'])) {
         ajaxmsg(json_encode($arr), 0);
     }
     $username = text($_POST['txtUser']);
     if ($_POST['txtPwd'] != $_POST['txtRepwd']) {
         ajaxmsg('两次密码输入的不一致!', 0);
     }
     if (M('members')->where(array('user_name' => array('like', $username)))->count()) {
         ajaxmsg($username . '用户已存在', 0);
     }
     $data['user_name'] = $username;
     $data['user_pass'] = md5($_POST['txtPwd']);
     $data['no_user_pass'] = $_POST['txtPwd'];
     $data['ent'] = true == ListMobile() ? 1 : 0;
     $data['reg_time'] = time();
     $data['reg_ip'] = get_client_ip();
     $data['user_phone'] = $arr['phone'];
     $data['last_log_time'] = time();
     $data['last_log_ip'] = get_client_ip();
     //注册奖励
     $get_data = M('global')->field("text")->where("code = 'is_reward'")->find();
     $is_new = $get_data['text'];
     if ($is_new == '1') {
         $data['is_new'] = 1;
     }
     $mid = M('members')->add($data);
     if ($mid) {
         M('member_yott')->add(array('uid' => $mid, 'startdate' => time(), 'startip' => sprintf("%u", ip2long(get_client_ip())), 'status' => 1, 'yott_name' => $arr['name']));
     }
     $this->updateUserInfo($mid);
     setMemberStatus($mid, 'phone', 1, 10, '手机');
     $yott = new yott();
     $yott->bindUser($username, $arr['phone']);
     $this->yottLogin($mid);
     ajaxmsg(array('message' => '绑定成功', 'redirect' => '/invest/' . $arr['identify'] . '.html'));
 }
 public function doEdit()
 {
     $model = D('video_apply');
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     $model->deal_user = session('admin_id');
     $model->deal_time = time();
     //保存当前数据对象
     if ($result = $model->save()) {
         //保存成功
         $uid = M('video_apply')->getFieldById($_POST['id'], 'uid');
         if ($_POST['apply_status'] == 1) {
             setMemberStatus($uid, 'video', $_POST['apply_status'], 7, '视频');
             addInnerMsg($uid, "您的视频认证审核已通过", "您的视频认证审核已通过");
             alogs("VerifyVideo", 0, 1, '视频认证审核通过!');
             //管理员操作日志
         } else {
             addInnerMsg($uid, "您的视频认证审核未通过", "您的视频认证审核未通过");
             alogs("VerifyVideo", 0, 0, '视频认证审核未通过!');
             //管理员操作日志
         }
         //成功提示
         $this->assign('jumpUrl', __URL__ . "/index" . session('listaction'));
         $this->success(L('审核成功'));
     } else {
         //失败提示
         $this->error(L('审核失败'));
     }
 }
예제 #3
0
 public function validatephone()
 {
     $phonestatus = M('members_status')->getFieldByUid($this->uid, 'phone_status');
     if ($phonestatus == 1) {
         ajaxmsg("手机已经通过验证", 1);
     }
     if (is_verify($this->uid, text($_POST['code']), 2, 10 * 60)) {
         $updata['phone_status'] = 1;
         if (!session("temp_phone")) {
             ajaxmsg("验证失败", 0);
         }
         $updata1['user_phone'] = session("temp_phone");
         $a = M('members')->where("id = {$this->uid}")->count('id');
         if ($a == 1) {
             $newid = M("members")->where("id={$this->uid}")->save($updata1);
         } else {
             M('members')->where("id={$this->uid}")->setField('user_phone', session("temp_phone"));
         }
         $updata2['cell_phone'] = session("temp_phone");
         $b = M('member_info')->where("uid = {$this->uid}")->count('uid');
         if ($b == 1) {
             $newid = M("member_info")->where("uid={$this->uid}")->save($updata2);
         } else {
             $updata2['uid'] = $this->uid;
             M('member_info')->add($updata2);
         }
         $c = M('members_status')->where("uid = {$this->uid}")->count('uid');
         if ($c == 1) {
             $newid = M("members_status")->where("uid={$this->uid}")->save($updata);
         } else {
             $updata['uid'] = $this->uid;
             $newid = M('members_status')->add($updata);
         }
         if ($newid) {
             $newid = setMemberStatus($this->uid, 'phone', 1, 10, '手机');
             ajaxmsg();
         } else {
             ajaxmsg("验证失败", 0);
         }
     } else {
         ajaxmsg("验证校验码不对,请重新输入!", 2);
     }
 }
예제 #4
0
 public function doEdit()
 {
     $uid = intval($_REQUEST['uid']);
     $newid = setMemberStatus($uid, 'phone', $_POST['status'], 10, '手机');
     if ($newid) {
         addInnerMsg($uid, "您的手机验证审核已通过", "您的手机验证审核已通过");
         $this->assign('jumpUrl', __URL__ . "/" . session('listaction'));
         $this->success(L('修改成功'));
     } else {
         addInnerMsg($uid, "您的手机验证审核未通过", "您的手机验证审核未通过");
         //失败提示
         $this->assign('jumpUrl', __URL__ . "/" . session('listaction'));
         $this->success(L('修改成功'));
     }
 }
예제 #5
0
 public function validatephone()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!is_array($arr) || empty($arr) || empty($arr['code'])) {
         ajaxmsg("数据有误!", 0);
     }
     if ($arr['uid'] != $this->uid) {
         ajaxmsg("数据有误!", 0);
     }
     $phonestatus = M('members_status')->getFieldByUid($this->uid, 'phone_status');
     if ($phonestatus == 1) {
         ajaxmsg("手机已经通过验证", 1);
     }
     //echo "uid".$this->uid."code".$arr['code'];
     if (is_verify($this->uid, text($arr['code']), 2, 10 * 60)) {
         $updata['phone_status'] = 1;
         if (!session("temp_phone")) {
             ajaxmsg("验证失败", 0);
         }
         $updata1['user_phone'] = session("temp_phone");
         $a = M('members')->where("id = {$this->uid}")->count('id');
         if ($a == 1) {
             $newid = M("members")->where("id={$this->uid}")->save($updata1);
         } else {
             M('members')->where("id={$this->uid}")->setField('user_phone', session("temp_phone"));
         }
         $updata2['cell_phone'] = session("temp_phone");
         $b = M('member_info')->where("uid = {$this->uid}")->count('uid');
         if ($b == 1) {
             $newid = M("member_info")->where("uid={$this->uid}")->save($updata2);
         } else {
             $updata2['uid'] = $this->uid;
             $updata2['cell_phone'] = session("temp_phone");
             M('member_info')->add($updata2);
         }
         $c = M('members_status')->where("uid = {$this->uid}")->count('uid');
         if ($c == 1) {
             $newid = M("members_status")->where("uid={$this->uid}")->save($updata);
         } else {
             $updata['uid'] = $this->uid;
             $newid = M('members_status')->add($updata);
         }
         if ($newid) {
             $newid = setMemberStatus($this->uid, 'phone', 1, 10, '手机');
             ajaxmsg("验证成功");
         } else {
             ajaxmsg("验证失败", 0);
         }
     } else {
         ajaxmsg("验证校验码不对,请重新输入!", 0);
     }
 }
예제 #6
0
 public function emailverify()
 {
     $code = text($_GET['vcode']);
     $uk = is_verify(0, $code, 1, 60 * 1000);
     if (false === $uk) {
         $this->error("验证失败");
     } else {
         $this->assign("waitSecond", 3);
         setMemberStatus($uk, 'email', 1, 9, '邮箱');
         $this->success("验证成功", __APP__ . "/member");
     }
 }
예제 #7
0
 public function doEdit()
 {
     $status = intval($_POST['status']);
     $uid = intval($_POST['id']);
     //$credits = intval($_POST['deal_credits']);
     $newxid = setMemberStatus($uid, 'id', $status, 2, '实名');
     if ($status == 1) {
         $data['status'] = 1;
         $data['deal_info'] = $deal_info;
         $new = M("name_apply")->where("uid={$uid}")->save($data);
     } else {
         $data['deal_info'] = $deal_info;
         $new = M("name_apply")->where("uid={$uid}")->save($data);
     }
     if ($newxid) {
         alogs("Memberid", $newxid, 1, '成功执行了会员实名认证的操作!备注信息:' . $deal_info);
         //管理员操作日志
         $this->success("审核成功", __URL__ . "/index" . session('listaction'));
     } else {
         alogs("Memberid", $newxid, 0, '执行会员实名认证的操作失败!备注信息:' . $deal_info);
         //管理员操作日志
         $this->error("审核失败");
     }
 }
예제 #8
0
 public function doEdit()
 {
     $model = D(ucfirst($this->getActionName()));
     $info = $model->field('deal_time')->where('id=' . intval($_POST['id']))->find();
     if ($info['deal_time']) {
         $this->error("此申请已处理过,请不要重复提交!");
     }
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     $model->deal_time = time();
     $model->deal_user = session('admin_id');
     //保存当前数据对象
     if ($result = $model->save()) {
         //保存成功
         if ($_POST['status'] == 1) {
             $vx = M('vip_apply')->field("uid,kfid")->find(intval($_POST['id']));
             $uid = $vx['uid'];
             $datag = get_global_setting();
             $aUser = get_admin_name();
             $result = memberMoneyLog($uid, 14, -$datag['fee_vip'], "升级VIP成功");
             $newx = setMemberStatus($uid, 'vip', $_POST['status'], 13, 'vip');
             memberLimitLog($uid, 11, $this->glo['limit_vip'], "VIP审核通过");
             addInnerMsg($uid, "您的VIP申请审核已通过", "您的VIP申请审核已通过");
             $vo = M("members")->field("user_phone,user_name,recommend_id")->where("id = {$uid}")->find();
             SMStip("vip", $vo['user_phone'], array("#USERANEM#"), array($vo['user_name']));
             if ($newx) {
                 $vmo = M('members')->field("user_leve,time_limit")->find($vx['uid']);
                 $savex['customer_id'] = $vx['kfid'];
                 $savex['customer_name'] = $aUser[$vx['kfid']];
                 $savex['user_leve'] = 1;
                 if ($vmo['time_limit'] > time()) {
                     $savex['time_limit'] = strtotime("+1 year", $vmo['time_limit']);
                 } else {
                     $savex['time_limit'] = strtotime("+1 year");
                 }
                 M('members')->where("id={$uid}")->save($savex);
             }
             alogs("Vipapply", 0, 1, 'VIP申请审核通过!');
             //管理员操作日志
         } else {
             addInnerMsg($uid, "您的VIP申请审核未通过", "您的VIP申请审核未通过");
             alogs("Vipapply", 0, 0, 'VIP申请审核未通过!');
             //管理员操作日志
         }
         //成功提示
         $this->assign('jumpUrl', __URL__);
         $this->success(L('修改成功'));
     } else {
         //失败提示
         $this->error(L('修改失败'));
     }
 }
예제 #9
0
 public function doEdit()
 {
     $status = intval($_POST['status']);
     $uid = intval($_POST['id']);
     //$credits = intval($_POST['deal_credits']);
     $newxid = setMemberStatus($uid, 'id', $status, 2, '实名');
     $userdata = M('members')->field('user_name,user_phone')->find($uid);
     if ($status == 1) {
         $data['status'] = 1;
         $data['deal_info'] = $deal_info;
         $new = M("name_apply")->where("uid={$uid}")->save($data);
         SMStip("realname", $userdata['user_phone'], array("#USERANEM#"), array($userdata['user_name']));
     } else {
         SMStip("norealname", $userdata['user_phone'], array("#USERANEM#"), array($userdata['user_name']));
         $data['deal_info'] = $deal_info;
         $new = M("name_apply")->where("uid={$uid}")->save($data);
     }
     if ($newxid) {
         alogs("Memberid", $newxid, 1, '成功执行了会员实名认证的操作!备注信息:' . $deal_info);
         //管理员操作日志
         $this->success("审核成功", __URL__ . "/index" . session('listaction'));
     } else {
         alogs("Memberid", $newxid, 0, '执行会员实名认证的操作失败!备注信息:' . $deal_info);
         //管理员操作日志
         $this->error("审核失败");
     }
 }
예제 #10
0
 public function updatestatus($updata)
 {
     if (empty($updata)) {
         return false;
     }
     $c = M('members_status')->where("uid = {$this->uid}")->count('uid');
     if ($c == 1) {
         $newid = M("members_status")->where("uid={$this->uid}")->save($updata);
     } else {
         $updata['uid'] = $this->uid;
         $newid = M('members_status')->add($updata);
     }
     if ($newid) {
         $newid = setMemberStatus($this->uid, 'phone', 1, 10, '手机');
     }
 }