コード例 #1
0
ファイル: User.php プロジェクト: derek-chow/YunYinService
 /**
  * 邮箱获取用户
  * @method getByEmail
  * @param  [type]     $email [description]
  * @return [type]            [description]
  * @author NewFuture
  */
 public static function getByEmail($email)
 {
     if (strrpos($email, '@') == 1) {
         /*单字母邮箱*/
         return self::where('email', 'LIKE', substr_replace($email, '%', 0, 1))->where('length(`email`)<' . (strlen($email) + 23))->find();
     } else {
         /*正常邮箱*/
         $email = Encrypt::encryptEmail($email);
         return self::where('email', $email)->find();
     }
 }