fix(system): 修正用户查询SQL条件和限制返回条数

- 调整了查询条件缩进,提升可读性
- 增加对超级管理员或管理员身份的过滤条件
- 添加了返回结果限制,确保只返回一条记录
This commit is contained in:
2026-07-23 16:51:05 +08:00
parent 61d8c6317e
commit ac166e340d

View File

@@ -387,8 +387,10 @@
FROM sys_user a
LEFT JOIN sys_tenant t ON a.tenant_id = t.tenant_id
WHERE a.deleted = 0
AND a.email = #{email}
AND a.email = #{email}
AND (u.is_super_admin = 1 OR u.is_admin = 1)
ORDER BY a.create_time DESC
LIMIT 1
</select>
<!-- 根据手机号统计账号数量(忽略租户隔离) -->