浏览代码

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

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