User name cannot be a pure number when registering, prevent one person's user name and another person's mobile phone number same
Public Function Login () { if (is_ajax) { $username = I (' param.username '); Var_dump ($username); $password = I (' Param.password '); $user = M ("Cuser"); $res = $user->where ("login_id= ' {$username} ' OR phone= ' {$username} ')->find (); if (!empty ($res) && $res [' Password ']==md5 ($password)) { $status = 1;//username is correct, password is correct. }elseif (!empty ($res) && $res [' Password ']!==md5 ($password)) { $status = 2;//username is correct, password is incorrect. }elseif (Empty ($res)) { $status = 3;//user name does not exist. } $this->ajaxreturn ($status); Exit (); } $mobile = Parent::ismobile (); if ($mobile = = "true") { $this->display (wap_login); } else{ $this->display (Login); } }
thinkphp phone number and user name at the same time