修复查询数据错误
This commit is contained in:
parent
1bed10c5e5
commit
a164def0cd
|
|
@ -50,9 +50,9 @@ func FindShellByID(id, uid uint) []Shell {
|
||||||
func FindShellByAuthID(auth_id int) []Shell {
|
func FindShellByAuthID(auth_id int) []Shell {
|
||||||
var shells []Shell
|
var shells []Shell
|
||||||
if proto.Config.SERVER_SQL_LOG {
|
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 {
|
} 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
|
return shells
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue