|
@@ -6,9 +6,11 @@ if($method_type=="post"){
|
|
|
$phone=$_POST['phone'];
|
|
|
$password=$_POST['pass'];
|
|
|
$time=date("Y-m-d H:i:s");
|
|
|
- $user_stmit=$pdo->query("select * from users where `phone`=".$phone .' limit 1');
|
|
|
+ $user_stmit=$pdo->query("select * from users where `phone`='".$phone."'".' limit 1');
|
|
|
+
|
|
|
$user=$user_stmit->fetch(PDO::FETCH_ASSOC);
|
|
|
- if(empty($user))exit(json_encode(['code'=>0,"msg"=>"改手机号已存在"]));
|
|
|
+
|
|
|
+ if(!empty($user))exit(json_encode(['code'=>0,"msg"=>"改手机号已存在"]));
|
|
|
$stmit=$pdo->prepare("insert into users(`phone`,`password`,`created_at`, `updated_at`)values(?,?,?,?)");
|
|
|
$stmit->execute(array($phone,$password,$time,$time));
|
|
|
$id=$pdo->lastInsertId();
|
|
@@ -108,7 +110,7 @@ if($method_type=="post"){
|
|
|
} else {
|
|
|
if (data.code == 1) {
|
|
|
layer.msg(data.msg, {time:2000,shift: 6 }, function () {
|
|
|
- window.location.href = "/recharge.html";
|
|
|
+ window.location.href = "/home";
|
|
|
});
|
|
|
}
|
|
|
}
|