/** * * 重置密码发送验证码接口 ... */ public function rePasswordSendSms() { $memberId = 0; if ($memberName = trimall($this->input['member_name'])) { if (hg_check_email_format($memberName)) { $this->errorOutput('请填写正确的用户名'); } if (hg_verify_mobile($memberName)) { $memberId = $this->Members->get_member_id($memberName, false, false, 'shouji'); if ($memberId) { $isMobile = 1; $platform_id = $memberName; } } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'm2o'); } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'uc'); } if (!$memberId) { $this->errorOutput(NO_MEMBER); } if (!$isMobile) { if ($mobile = trimall($this->input['mobile'])) { $checkBind = new check_Bind(); $platform_id = $checkBind->check_Bind($memberId, 'shouji'); if ($platform_id && $platform_id != $mobile) { $this->errorOutput('对不起,您填写的手机号不正确,请重新输入!'); } elseif (empty($platform_id)) { $this->errorOutput('对不起,您需找回的帐号未绑定手机号!'); } } else { $this->errorOutput('请输入正确的手机号,并获取验证码!'); } } $this->send_sms(); } else { $this->errorOutput(NO_MEMBER_NAME); } }
public function checkUc() { try { $identifierUserSystem = new identifierUserSystem(); $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 $check_Bind = new check_Bind(); if ($this->input['platform_id']) { $platform_id = $this->input['platform_id']; $type = $this->input['type']; } elseif ($this->input['member_name']) { $user_name = trim($this->input['member_name']); $member_id = $check_Bind->bind_to_memberid($user_name, 'uc', false, $identifier); //优先检测uc类型 $type = 'uc'; if (empty($member_id)) { $member_id = $check_Bind->bind_to_memberid($user_name, 'm2o', false, $identifier); $type = 'm2o'; } if (empty($member_id)) { $member_id = $check_Bind->bind_to_memberid($user_name, 'shouji', false, $identifier); $type = 'shouji'; } if (empty($member_id)) { $platform_id = $this->input['member_name']; $type = $this->input['type']; } } $is_bind = 0; if (empty($member_id)) { $member_id = $check_Bind->bind_to_memberid($platform_id, $type, true, $identifier); } $is_bind = $check_Bind->check_uc($member_id, $type); $this->addItem_withkey('is_bind', $is_bind); $this->output(); } catch (Exception $e) { $this->errorOutput($e->getMessage(), $e->getCode()); } }
/** * * 找回密码验证方法(支持验证输入的手机号是否已经绑定) ... */ public function reSetPasswordUser() { $type = isset($this->input['type']) ? intval($this->input['type']) : -1; //找回类型 $identifierUserSystem = new identifierUserSystem(); $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 $memberId = 0; $isEmail = 0; $isMobile = 0; if ($memberName = trimall($this->input['member_name'])) { if (hg_check_email_format($memberName)) { $memberId = $this->Members->get_member_id($memberName, false, false, 'email', $identifier); if ($memberId) { $isEmail = 1; $platform_id = $memberName; } } elseif (hg_verify_mobile($memberName)) { $memberId = $this->Members->get_member_id($memberName, false, false, 'shouji', $identifier); if ($memberId) { $isMobile = 1; $platform_id = $memberName; } } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'm2o', $identifier); } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'uc', $identifier); } if (!$memberId) { $this->errorOutput(NO_MEMBER); } if ($type == 1) { if (!$isEmail) { if ($email = trimall($this->input['email'])) { $checkBind = new check_Bind(); $platform_id = $checkBind->check_Bind($memberId, 'email'); if ($platform_id && $platform_id != $email) { $this->errorOutput(EMAIL_BIND_ACCOUNT_ERROR); } else { if (!$platform_id) { $this->errorOutput(EMAIL_NO_BIND_ACCOUNT); } } } else { $this->errorOutput(EMAIL_INPUT_BIND_ACCOUNT); } } } elseif ($type == 0) { if (!$isMobile) { if ($mobile = trimall($this->input['mobile'])) { $checkBind = new check_Bind(); $platform_id = $checkBind->check_Bind($memberId, 'shouji'); if ($platform_id && $platform_id != $mobile) { $this->errorOutput(MOBILE_BIND_ACCOUNT_ERROR); } elseif (empty($platform_id)) { $this->errorOutput(MOBILE_NO_BIND_ACCOUNT); } } else { $this->errorOutput(MOBILE_INPUT_BIND_ACCOUNT); } } } else { $this->errorOutput(REPASSWORD_TYPE_ERROR); } $this->input['member_name'] = $platform_id; $this->reset_password(); } else { $this->errorOutput(NO_MEMBER_NAME); } }
public function checkUc($member_id) { $ucid = 0; $checkBind = new check_Bind(); $ucid = $checkBind->check_uc($member_id); if (!$ucid) { $ucid = $checkBind->check_uc($member_id, 'uc'); } return $ucid; }
/** * 检查手机号 格式 是否被注册 */ public function checkmobile() { try { $identifierUserSystem = new identifierUserSystem(); $mobile = $this->input['mobile'] ? $this->input['mobile'] : 0; $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 if ($mobile && !hg_verify_mobile($mobile)) { $this->errorOutput(MOBILE_NUMBER_FORMAT_ERROR); } else { if ($mobile || defined('NO_VERIFY_MOBILEBIND') && NO_VERIFY_MOBILEBIND) { $check_bind = new check_Bind(); if ($check_bind->checkmembernamereg($mobile, $identifier)) { $this->errorOutput(MOBILE_REG_BIND); } } } } catch (Exception $e) { $this->errorOutput($e->getMessage(), $e->getCode()); } }
/** * 产生邀请信息.目前仅支持手机邀请. */ public function generate_invite() { if ($this->user['user_id']) { $member_id = intval($this->user['user_id']); } $re['status'] = 0; $re['msg'] = '您未登陆,请登陆后再次邀请!'; if ($member_id) { $select = array(); $sendto = ''; if ($mobile = intval($this->input['mobile'])) { $checkBind = new check_Bind(); $check_info = $checkBind->bind_to_memberid($mobile, 'shouji', true); if (empty($check_info)) { $sendto = $code = $mobile; if ($code) { $condition['code'] = $code; } $condition['type'] = $type = 1; $select = $this->invite->select($condition); $send_status = $this->send_sms(); if ($send_status) { $re['status'] = $status = 3; //发送成功 $re['msg'] = '短信通知成功'; } else { $re['status'] = $status = 4; //发送失败 $re['msg'] = '短信通知失败,您可以主动通知好友或者重新尝试发送邀请!'; } } else { $re['msg'] = '您邀请的好友已经是会员,无需邀请!'; } } elseif ($email = trim($this->input['email'])) { $check_info = $this->Members->get_member_id($email, true, false); if (empty($check_info)) { $sendto = $code = $email; if ($code) { $condition['code'] = $code; } $condition['type'] = $type = 2; $select = $this->invite->select($condition); } else { $re['msg'] = '您邀请的好友已经是会员,无需邀请!'; } } else { $code = strtolower(random(6)); $condition['type'] = $type = 0; $status = 1; //不发送 $re['status'] = $status = 1; //未发送邀请 $re['msg'] = '您的邀请码为:' . $code . ',请复制邀请码并通过QQ,E-mail,论坛告知您的好友!'; } if (empty($check_info)) { $setarr = array('member_id' => $member_id, 'code' => $code, 'type' => $type, 'sendto' => $sendto, 'inviteip' => hg_getip(), 'dateline' => TIMENOW, 'status' => $status, 'endtime' => $this->settings['member_invite']['invite_endtime'] ? TIMENOW + $this->settings['member_invite']['invite_endtime'] * 3600 : 0); if (empty($select)) { $ret = $this->invite->insert($setarr); } else { $ret = $this->invite->update($setarr, $condition); } $re['code'] = $code; } } if ($re & is_array($re)) { foreach ($re as $k => $v) { $this->addItem_withkey($k, $v); } } $this->output(); }
public function detail() { $this->verify_content_prms(array('_action' => 'show')); $member_id = trim($this->input['id']); if (!$member_id) { $this->errorOutput(NO_MEMBER_ID); } $member = $this->mMember->detail($member_id); if (empty($member)) { $this->errorOutput(NO_MEMBER); } $member_medal = $this->Members->get_member_medal(array($member_id)); $member['medal_id'] = @array_keys($member_medal[$member_id]); $member['medal_id'] = $member['medal_id'] ? $member['medal_id'] : array(); if (empty($member['graname'])) { $grade_info = $this->Members->updategrade($member_id); if ($grade_info && is_array($grade_info)) { foreach ($grade_info as $key => $val) { $member[$key] = $val; } } } if (empty($member['groupname'])) { $group_info = $this->Members->updategroup($member_id, 0); if ($group_info && is_array($group_info)) { foreach ($group_info as $key => $val) { $member[$key] = $val; } } } if (!empty($member) && $member_id) { unset($member['password'], $member['salt']); // 积分信息 $credits = $this->Members->membercredit($member_id, $is_on = 1); // 黑名单信息 $blacklist = $this->Members->blacklist($member_id); //绑定信息 $bind = $this->mMember->get_bind_info(" AND mb.member_id = " . $member_id); //获取邀请人 $invite_user = $this->get_invite_user($member_id); //扩展信息 $member_info = $this->mMemberInfo->show(" AND member_id = " . $member_id); } //扩展字段表信息处理 if (intval($this->input['app_id'])) { $extension = $this->mMemberInfo->extendDataProcessByApp($member_info, 1, $this->input['app_id']); } else { $extension = $this->mMemberInfo->extendDataProcess($member_info); } $return = $member; if ($bind && is_array($bind)) { $is_flag = true; foreach ($bind as $bin) { if ($is_flag) { $return['nick_name'] = $bin['nick_name']; $return['nick_name'] && ($is_flag = false); } } } if (!$return['nick_name']) { $return['nick_name'] = $return['member_name']; } $check_bind = new check_Bind(); $inuc = $check_bind->check_uc($member['member_id'], $member['type']); $tmp_return = $this->mMember->getIdentifierName(array($return)); //获取会员加入的群组 if ($this->input['need_group_count']) { $groupCount = $this->im->getGroupCountBymemberId($member_id); } //获取好友粉丝数量 if ($this->input['need_friend_count']) { //好友的 $condition = " AND (member_id=" . $member_id . " AND relation_type=3) or (friend_id=" . $member_id . " AND relation_type=3)"; $friend_num = $this->friend->count($condition); //获取粉丝数 $condition = " AND (member_id=" . $member_id . " AND relation_type<>1) or (friend_id=" . $member_id . " AND relation_type<>2)"; $fans_num = $this->friend->count($condition); } $return = $tmp_return[0]; $return['inuc'] = $inuc; $return['isNameUpdate'] = $this->mMember->isMemberNameUpdate($member['member_id'], 1); $return['inviteuser'] = $invite_user ? $invite_user : array(); $return['credit'] = $credits[$member['member_id']]; $return['blacklist'] = $blacklist[$member['member_id']]; $return['bind'] = $bind; $return['extension'] = $extension; $return['groupCount'] = $groupCount['total'] ? $groupCount['total'] : 0; $return['friendCount'] = $friend_num['total'] ? $friend_num['total'] : 0; $return['fansCount'] = $fans_num['total'] ? $fans_num['total'] : 0; $this->addItem($return); $this->output(); }
/** * * 补充新浪绑定,QQ绑定等第三方绑定信息为正常M2O账号 ... * 目的是为了解决 新浪、QQ等第三方平台首次直接登陆系统后,资料信息不完善问题 */ public function supplementaryBindInfo() { try { $identifierUserSystem = new identifierUserSystem(); $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 $member_name = $this->input['member_name']; $nick_name = $this->input['nick_name']; if (empty($member_name)) { $this->errorOutput(NO_MEMBER_NAME); } //如果是m2o注册类型屏蔽字检测 if ($this->settings['App_banword']) { include ROOT_PATH . 'lib/class/banword.class.php'; $banword = new banword(); $member_name_banword = $banword->exists($member_name); if ($member_name_banword && is_array($member_name_banword)) { $this->errorOutput(MEMBER_NAME_INVALID); } } switch ($this->mMember->verify_member_name($member_name, $user_id, $identifier)) { case -1: $this->errorOutput(MEMBER_NAME_ILLEGAL); break; case -2: $this->errorOutput(PROHIBITED_WORDS); break; case -3: $this->errorOutput(UC_MEMBER_NAME_REGISTER); break; case -4: $this->errorOutput(MEMBER_NAME_EXCEEDS_MAX); break; case -5: $this->errorOutput(USERNAME_BELOW_MINIMUM); break; case -6: $this->errorOutput(MEMBER_NAME_ERROR); break; case -7: $this->errorOutput(MEMBER_NAME_REGISTER); break; default: break; } $mobile_verifycode = trim($this->input['mobile_verifycode']); $email_verifycode = trim($this->input['email_verifycode']); $email = $this->input['email']; if (empty($email)) { $this->errorOutput(NO_EMAIL); } $reg_mail = $this->Members->check_reg_mail($email, 0, $identifier); if ($reg_mail == -4) { $this->errorOutput(EMAIL_FORMAT_ERROR); } elseif ($reg_mail == -5) { $this->errorOutput(EMAIL_NO_REGISTER); } elseif ($reg_mail == -6) { $this->errorOutput(EMAIL_HAS_BINDED); } if ($email && isset($this->input['email_verifycode'])) { if ($this->memberverifycode->get_verifycode_info($email, $email_verifycode, 1, $action = 1)) { //验证成功之后删除 $this->memberverifycode->verifycode_delete($member_name, $email_verifycode, 1, $action = 1); } else { $this->errorOutput(VERIFY_FAILED); } $this->isemailverify = 1; } $mobile = $this->input['mobile']; //简单验证手机号格式 if ($mobile && !hg_verify_mobile($mobile)) { $this->errorOutput(MOBILE_NUMBER_FORMAT_ERROR); } else { if ($mobile && (isset($this->input['mobile_verifycode']) || defined('NO_VERIFY_MOBILEBIND') && NO_VERIFY_MOBILEBIND)) { $check_bind = new check_Bind(); if ($check_bind->checkmembernamereg($mobile, $identifier)) { $this->errorOutput(MOBILE_REG_BIND); } } } if ($mobile && isset($this->input['mobile_verifycode'])) { //验证码 $verifycode = $this->mSmsServer->get_verifycode_info($mobile, $mobile_verifycode); if (empty($verifycode)) { $this->errorOutput(VERIFY_FAILED); } //删除验证码 $this->mSmsServer->mobile_verifycode_delete($mobile, $mobile_verifycode); if (TIMENOW > $verifycode['create_time'] + VERIFYCODE_EXPIRED_TIME) { $this->errorOutput(VERIFY_EXPIRED); } $this->ismobileverify = 1; } $password = $this->input['password']; $user_id = $this->user['user_id']; if (!$user_id) { $this->errorOutput(NO_MEMBER_ID); } $cond = ' AND member_id = ' . $user_id; $memberInfo = $this->Members->get_member_info($cond); if (!$memberInfo) { $this->errorOutput(NO_MEMBER); } if ($memberInfo['type'] == 'm2o' || $memberInfo['type'] == 'uc') { $this->errorOutput(UPDATEM2O); } $updateMemberInfo['member_id'] = $user_id; $updateMemberInfo['type'] = 'm2o'; $updateMemberInfo['type_name'] = 'M2O'; $updateMemberInfo['member_name'] = $member_name; if (empty($password)) { $this->errorOutput(NO_PASSWORD); } $salt = hg_generate_salt(); $updateMemberInfo['salt'] = $salt; $md5_password = md5(md5($password) . $salt); $updateMemberInfo['password'] = $md5_password; $email && ($updateMemberInfo['email'] = $email); $mobile && ($updateMemberInfo['mobile'] = $mobile); $this->mMember->update($updateMemberInfo); $membersql = new membersql(); $this->mMember->bind_update(array('is_primary' => 0), $membersql->where(array('member_id' => $memberInfo['member_id'], 'type' => $memberInfo['type']))); $platform_id = $user_id; $inuc = 0; if (!$identifier && $this->settings['ucenter']['open']) { $register_data = array('member_name' => $member_name, 'password' => $password, 'email' => $email); $registerInfo = $this->mMember->uc_register($register_data); if ($registerInfo['member_id'] > 0) { $inuc = $platform_id = $registerInfo['member_id']; } } //M2O绑定关系 $bind_data = array('member_id' => $user_id, 'platform_id' => $platform_id, 'nick_name' => $nick_name, 'type' => 'm2o', 'type_name' => 'M2O', 'bind_time' => TIMENOW, 'bind_ip' => hg_getip(), 'inuc' => $inuc, 'is_primary' => 1, 'identifier' => $identifier, 'reg_device_token' => 'www', 'reg_udid' => $udid); $ret_bind = $this->mMember->bind_create($bind_data); //如果注册时填写邮箱则可以同时入绑定表 if ($email) { if ($this->isemailverify || defined('NO_VERIFY_EMAILBIND') && NO_VERIFY_EMAILBIND) { $_bind_data = $bind_data; $_bind_data['platform_id'] = $email; $_bind_data['is_primary'] = 0; $_bind_data['type'] = 'email'; $_bind_data['type_name'] = '邮箱'; $_ret_bind = $this->mMember->bind_create($_bind_data); if (empty($_ret_bind)) { $this->errorOutput(BIND_DATA_ADD_FAILED); } unset($_bind_data, $_ret_bind); } } if ($mobile) { if ($this->ismobileverify || defined('NO_VERIFY_MOBILEBIND') && NO_VERIFY_MOBILEBIND) { $_bind_data = $bind_data; $_bind_data['platform_id'] = $mobile; $_bind_data['is_primary'] = 0; $_bind_data['type'] = 'shouji'; $_bind_data['type_name'] = '手机'; $_ret_bind = $this->mMember->bind_create($_bind_data); if (empty($_ret_bind)) { $this->errorOutput(BIND_DATA_ADD_FAILED); } unset($_bind_data, $_ret_bind); } } if ($inuc) { $_updateBind = array('inuc' => $inuc); $this->mMember->bind_update($_updateBind, ' WHERE member_id = ' . $user_id); } $this->addItem($bind_data); $this->output(); } catch (Exception $e) { $this->errorOutput($e->getMessage(), $e->getCode()); } }
/** * 验证会员 * $member_name 会员名 * $password 密码 * $type 登陆类型 * $appid * $appkey */ public function verify_member() { try { $encrypt = $this->input['encrypt'] ? intval($this->input['encrypt']) : 0; $platform_id = trim($this->input['platform_id']); $password = $encrypt ? passport_decrypt(trim($this->input['password']), CUSTOM_APPKEY) : trim($this->input['password']); $type = trim($this->input['type']); $_type = trim($this->input['_type']); //防止本地M2O同步至UC后,再次验证本地密码BUG。 $identifierUserSystem = new identifierUserSystem(); $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 $ip = hg_getip(); $need_password_type = array('shouji', 'm2o', 'email'); $appid = intval($this->input['appid']); $appkey = trim($this->input['appkey']); //会员名 if (!$platform_id) { $this->errorOutput(NO_MEMBER_NAME); } //密码 if (!$password && in_array($type, $need_password_type)) { $this->errorOutput(NO_PASSWORD); } $condition = " AND mb.platform_id = '" . $platform_id . "' AND mb.type = '" . $type . "' AND mb.identifier = '" . $identifier . '\''; $_bind = $this->mMember->get_bind_info($condition); $bind = array(); if (is_array($_bind) && count($_bind) > 1) { foreach ($_bind as $v) { if ($v['inuc'] > 0) { $bind = $v; break; } } } elseif (is_array($_bind)) { $bind = $_bind[0]; } $member_id = intval($bind['member_id']); $platform_id = $bind['platform_id']; $condition = " AND m.member_id = " . $member_id; $fileds_array = array('member_id', 'member_name', 'password', 'salt', 'avatar', 'type', 'type_name', 'gid', 'gradeid', 'guid', 'signature', 'mobile', 'email', 'isVerify', 'identifier', 'last_login_device'); $fields = implode(',', $fileds_array); $member_info = $this->mMember->get_member_info($condition, $fields); $member_info = $member_info[0]; if (empty($member_info)) { $this->errorOutput(LOGIN_NOMEMBER_ERROR); } $isComplete = isUserComplete($member_info['type']); if (in_array($type, $need_password_type) && $_type != 'uc') { $encrypt_num = intval($this->input['encrypt_num']); if ($encrypt_num == 1) { $md5_password = md5($password . $member_info['salt']); } else { $md5_password = md5(md5($password) . $member_info['salt']); } if ($md5_password != $member_info['password']) { $this->errorOutput(PASSWORD_ERROR); } } else { //验证新浪微博、腾讯微博、QQ、人人、豆瓣 等 用户信息 //暂时不作处理 } //积分规则调用 $credit_rules = $this->Members->credits_rule('members_login_login', $member_info['member_id'], $coef = 1, $update = 1, APP_UNIQUEID); $copywriting_credit = copywriting_credit(array($credit_rules)); $check_Bind = new check_Bind(); $inuc = $check_Bind->check_uc($member_id, $type); if (!$inuc && ($_type == 'm2o' || $type == 'm2o') && $member_info['email']) { if ($inuc = $this->mMember->syncUcRegister($member_id, $member_info['member_name'], $password, $member_info['email'])) { $platform_id = $inuc; } } $return = array('user_id' => $member_info['member_id'], 'platform_id' => (string) $platform_id, 'inuc' => $inuc, 'user_name' => $member_info['member_name'], 'nick_name' => $bind['nick_name'], 'type' => $member_info['type'], 'avatar' => $member_info['avatar'], 'copywriting' => '登录成功', 'copywriting_credit' => $copywriting_credit, 'isVerify' => $member_info['isVerify'], 'identifier' => $member_info['identifier'], 'isComplete' => $isComplete); $return = array_merge($return, $member_info); $this->addItem($return); $this->output(); } catch (Exception $e) { $this->errorOutput($e->getMessage(), $e->getCode()); } }
/** * 检查绑定 */ private function checkMemberName($memberName) { if (hg_verify_mobile($memberName)) { $this->errorOutput('请填写正确的用户名'); } if (hg_check_email_format($memberName)) { $memberId = $this->Members->get_member_id($memberName, false, false, 'email'); if ($memberId) { $isEmail = 1; $platform_id = $memberName; $this->email = $memberName; } } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'm2o'); } if (!$memberId) { $memberId = $this->Members->get_member_id($memberName, false, false, 'uc'); } if (!$memberId) { $this->errorOutput(NO_MEMBER); } if (!$isEmail) { $this->email = trimall($this->input['email']); if ($this->email && hg_check_email_format($this->email)) { $checkBind = new check_Bind(); $platform_id = $checkBind->check_Bind($memberId, 'email'); if ($platform_id && $platform_id != $this->email) { $this->errorOutput(EMAIL_BIND_ACCOUNT_ERROR); } elseif (empty($platform_id)) { $this->errorOutput(EMAIL_NO_BIND_ACCOUNT); } } else { if ($this->email) { $this->errorOutput(EMAIL_FORMAT_ERROR); } else { $this->errorOutput(NO_EMAIL); } } } return $memberId; }
public function reset_mobile_bind() { $check_bind = new check_Bind(); $identifier = 0; //多套会员系统标记 $member_id = intval($this->user['user_id']); $new_mobile = $this->input['new_mobile']; $old_mobile = $this->input['old_mobile']; $code = $this->input['verifycode']; if (!$member_id) { $this->errorOutput(USER_NO_LOGIN); } //新手机确认 if (empty($new_mobile)) { $this->errorOutput(NEW_MOBILE_NOT_NUMBER); } elseif ($check_bind->checkmembernamereg($new_mobile, $identifier)) { $this->errorOutput(MOBILE_REG_BIND); } elseif (empty($old_mobile)) { $this->errorOutput(OLD_MOBILE_NOT_NUMBER); } $verifycode = $this->mSmsServer->get_verifycode_info($new_mobile, $code); if (!$verifycode) { $this->errorOutput(VERIFY_FAILED); } else { $this->mSmsServer->mobile_verifycode_delete($new_mobile, $code); } $where = ' AND member_id = ' . $member_id . ' AND type ="shouji" AND platform_id="' . $old_mobile . '"'; $sql = 'SELECT member_id,platform_id FROM ' . DB_PREFIX . 'member_bind WHERE 1 ' . $where; $bind = $this->db->query_first($sql); if (!$bind) { $this->errorOutput(MOBILE_NOT_BINDED); } $sql = 'UPDATE ' . DB_PREFIX . 'member_bind set nick_name="' . $new_mobile . '",platform_id="' . $new_mobile . '" WHERE 1 ' . $where; $this->db->query($sql); //如果主表的name $sql = 'UPDATE ' . DB_PREFIX . 'member set member_name="' . $new_mobile . '" WHERE member_id = ' . $member_id . ' AND member_name = "' . $old_mobile . '"'; $this->db->query($sql); //修改主表mobile字段 $sql = 'UPDATE ' . DB_PREFIX . 'member set mobile="' . $new_mobile . '" WHERE member_id = ' . $member_id; $this->db->query($sql); $this->addItem(array('mobile' => $new_mobile, 'member_id' => $member_id)); $this->output(); }