diff --git a/dao/shell.go b/dao/shell.go index 39d78ec..8d1c5bd 100644 --- a/dao/shell.go +++ b/dao/shell.go @@ -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 }