修复查询数据错误

This commit is contained in:
junleea 2025-03-11 14:32:39 +08:00
parent 1bed10c5e5
commit a164def0cd
1 changed files with 2 additions and 2 deletions

View File

@ -50,9 +50,9 @@ func FindShellByID(id, uid uint) []Shell {
func FindShellByAuthID(auth_id int) []Shell {
var shells []Shell
if proto.Config.SERVER_SQL_LOG {
DB.Debug().Exec("select * from shells where auth_id = ? order by created_at desc limit 100", auth_id).Scan(&shells)
DB.Debug().Where("auth_id = ?", auth_id).Order("created_at DESC").Limit(100).Find(&shells)
} else {
DB.Exec("select * from shells where auth_id = ? order by created_at desc limit 100", auth_id).Scan(&shells)
DB.Where("auth_id = ?", auth_id).Order("created_at DESC").Limit(100).Find(&shells)
}
return shells
}