Update: 2026-05-06 21:24:56
This commit is contained in:
@@ -41,10 +41,14 @@ try {
|
||||
$stmt->execute([$phoneHash]);
|
||||
$user = $stmt->fetch();
|
||||
} catch (\PDOException $e) {
|
||||
// Fallback to searching by plain phone if phone_hash column doesn't exist
|
||||
$stmt = $db->prepare("SELECT id, tenant_id, name, is_active FROM users WHERE phone = ? LIMIT 1");
|
||||
$stmt->execute([$phone]);
|
||||
$user = $stmt->fetch();
|
||||
try {
|
||||
// Fallback to searching by plain phone if phone_hash column doesn't exist
|
||||
$stmt = $db->prepare("SELECT id, tenant_id, name, is_active FROM users WHERE phone = ? LIMIT 1");
|
||||
$stmt->execute([$phone]);
|
||||
$user = $stmt->fetch();
|
||||
} catch (\PDOException $fallbackException) {
|
||||
json_error('حدث خطأ في قاعدة البيانات: ' . $fallbackException->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
|
||||
Reference in New Issue
Block a user