涉及到的php文件
MemberController.class.php
UcenterMemberModel.class.php
/** * 注册一个新用户 * @param string $username 用户名 * @param string $nickname 昵称 * @param string $password 用户密码 * @param string $email 用户邮箱 * @param string $mobile 用户手机号码 * @return integer 注册成功-用户信息,注册失败-错误编号 */ public function register($username, $nickname, $password, $email='', $mobile='', $type=1) { $data = array( 'username' => $username, 'password' => $password, 'email' => $email, 'mobile' => $mobile, 'type' => $type, ); //验证手机 if (empty($data['mobile'])) unset($data['mobile']); if (empty($data['username'])) unset($data['username']); if (empty($data['email'])) unset($data['email']); /* 添加用户 */ $usercenter_member = $this->create($data); if ($usercenter_member) { $result = D('Common/Member')->registerMember($nickname); if ($result > 0) { $usercenter_member['id'] = $result; $uid = $this->add($usercenter_member); //var_dump($this->_sql()); //echo ""; // var_dump($this);exit(); if ($uid === false) { //如果注册失败,则回去Memeber表删除掉错误的记录 D('Common/Member')->where(array('uid' => $result))->delete(); } action_log('reg','ucenter_member',1,1); return $uid ? $uid : 0; //0-未知错误,大于0-注册成功 } else { return $result; } } else { return $this->getError(); //错误详情见自动验证注释 } }
其中发现是存在sql语句,但是无法写入,却可以找到邮箱,这个问题确实非常奇怪.