소스 검색

注册用户的邮箱,也要去教练表查一下

lizhen_gitee 1 년 전
부모
커밋
30bf82a960
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 11 3
      application/common/library/Auth.php

+ 11 - 3
application/common/library/Auth.php

@@ -158,9 +158,17 @@ class Auth
             $this->setError('Nickname already exist');
             return false;
         }*/
-        if ($email && User::getByEmail($email)) {
-            $this->setError('Email already exist');
-            return false;
+        if ($email) {
+            if(User::getByEmail($email)){
+                $this->setError('Email already exist');
+                return false;
+            }
+
+            $check_coach = Db::name('coach')->where('email',$email)->find();
+            if(!empty($check_coach)){
+                $this->setError('Email already exist');
+                return false;
+            }
         }
         if ($mobile && User::getByMobile($mobile)) {
             $this->setError('Mobile already exist');