|
|
|
@ -307,13 +307,35 @@ class UserController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
|
|
|
|
$safeinfo = session('safeinfo');
|
|
|
|
|
if ($safeinfo['status'] == 1) {
|
|
|
|
|
// $safeinfo = session('safeinfo');
|
|
|
|
|
// if ($safeinfo['status'] == 1) {
|
|
|
|
|
if (IS_POST) {
|
|
|
|
|
|
|
|
|
|
$post = I('post.');
|
|
|
|
|
$account = $post['phone'];
|
|
|
|
|
$password = $post['password'];
|
|
|
|
|
$sex = isset($post['sex']) ? $post['sex'] : 0;
|
|
|
|
|
if (empty($account)) {
|
|
|
|
|
echo json_encode(array('status' => 0, 'msg' => '请输入手机号'));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
if (empty($password)) {
|
|
|
|
|
echo json_encode(array('status' => 0, 'msg' => '请输入密码'));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promoteId = I('post.promote_id');
|
|
|
|
|
$promoteId = intval($promoteId);
|
|
|
|
|
if ($promoteId > 0) {
|
|
|
|
|
$gameId = intval(I('post.game_id'));
|
|
|
|
|
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex, 'status' => 1, 'promote_id' => $promoteId, 'game_id' => $gameId);
|
|
|
|
|
} else {
|
|
|
|
|
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex, 'status' => 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$phone = $post['phone'];
|
|
|
|
|
$safecode = $post['code'];
|
|
|
|
|
$nickname = $safeinfo['nickname'];
|
|
|
|
|
$nickname = 'U_' . substr($safeinfo['nickname'],-4);
|
|
|
|
|
$password = $safeinfo['password'];
|
|
|
|
|
$sex = $safeinfo['sex'];
|
|
|
|
|
|
|
|
|
@ -423,9 +445,9 @@ class UserController extends BaseController
|
|
|
|
|
$this->assign('url', $url);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$this->redirect(U('step'));
|
|
|
|
|
}
|
|
|
|
|
// } else {
|
|
|
|
|
// $this->redirect(U('step'));
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -438,7 +460,8 @@ class UserController extends BaseController
|
|
|
|
|
if (IS_POST) {
|
|
|
|
|
$post = I('post.');
|
|
|
|
|
$account = $post['account'];
|
|
|
|
|
$nickname = $post['nickname'];
|
|
|
|
|
// $nickname = $post['nickname'];
|
|
|
|
|
$nickname = 'U_' . substr($account,-4);;
|
|
|
|
|
$password = $post['password'];
|
|
|
|
|
$sex = $post['sex'];
|
|
|
|
|
|
|
|
|
|