fix: 修复@提及uid始终为0的BUG + 空@提示优化
- SearchUsersByLevel SQL id列别名改为uid,修复GORM字段名映射导致uid=0 - @空输入时悬浮窗显示'输入以查找用户'而非空白 - 清理历史脏数据(uid=0的mention记录)
This commit is contained in:
@ -80,7 +80,7 @@ func (r *CommentRepo) SearchUsersByLevel(keyword string, minLevel int, limit int
|
||||
threshold := model.LevelThresholds[minLevel]
|
||||
|
||||
err := r.db.Table("users").
|
||||
Select("id, username, avatar, exp").
|
||||
Select("id AS uid, username, avatar, exp").
|
||||
Where("username LIKE ? AND exp >= ? AND deleted_at IS NULL", "%"+keyword+"%", threshold).
|
||||
Order("exp DESC").
|
||||
Limit(limit).
|
||||
|
||||
Reference in New Issue
Block a user