Merge pull request #594 from NyaaPantsu/fix-postgres-searchorder
Fix #570 2
Cette révision appartient à :
révision
51423e1d9f
1 fichiers modifiés avec 8 ajouts et 1 suppressions
|
@ -144,9 +144,16 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
|
|||
case "true":
|
||||
search.Order = true
|
||||
orderBy += "asc"
|
||||
if db.ORM.Dialect().GetName() == "postgres" {
|
||||
orderBy += " NULLS FIRST"
|
||||
}
|
||||
default:
|
||||
orderBy += "desc"
|
||||
}
|
||||
if db.ORM.Dialect().GetName() == "postgres" {
|
||||
orderBy += " NULLS LAST"
|
||||
}
|
||||
}
|
||||
|
||||
parameters := serviceBase.WhereParams{
|
||||
Params: make([]interface{}, 0, 64),
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket