Pārlūkot izejas kodu

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

lizhen_gitee 1 gadu atpakaļ
vecāks
revīzija
30bf82a960
1 mainītis faili ar 11 papildinājumiem un 3 dzēšanām
  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');