修正新员工在没有企业邮箱时,不能创建的问题
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user