فهرست منبع

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

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');