From d41fc55e617d1486748f03d76649ebaab16fdd29 Mon Sep 17 00:00:00 2001 From: mzl Date: Thu, 21 Aug 2025 14:31:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=B0=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E5=9C=A8=E6=B2=A1=E6=9C=89=E4=BC=81=E4=B8=9A=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E8=83=BD=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/AuthLogic.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/app/common/logic/AuthLogic.php b/app/common/logic/AuthLogic.php index 9857df8..c79b1d1 100644 --- a/app/common/logic/AuthLogic.php +++ b/app/common/logic/AuthLogic.php @@ -87,13 +87,21 @@ class AuthLogic try { $phone = $this->sanitizePhone($feishuUserInfo['mobile'] ?? ''); $email = $feishuUserInfo['enterprise_email']; - $user = User::where('corp_id', $feishuUserInfo['corp_id']) - ->where(function($query) use ($phone, $email) { - $query->where('phone', $phone) - ->orWhere('email', $email); - }) - ->first(); - + // $user = User::where('corp_id', $feishuUserInfo['corp_id']) + // ->where(function($query) use ($phone, $email) { + // $query->where('phone', $phone) + // ->orWhere('email', $email); + // }) + // ->first(); + $userByPhone = User::where('corp_id', $feishuUserInfo['corp_id']) + ->where('phone', $phone) + ->where('phone', '!=', '') + ->first(); + $userByEmail = User::where('corp_id', $feishuUserInfo['corp_id']) + ->where('email', $email) + ->where('email', '!=', '') + ->first(); + $user = $userByPhone ?: $userByEmail; if (!$user) { // 获取编号 $userSn = $this->getAvailableUserSn();