Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #594 from NyaaPantsu/fix-postgres-searchorder

Fix #570 2
Cette révision appartient à :
akuma06 2017-05-17 23:41:54 +02:00 révisé par GitHub
révision 51423e1d9f

Voir le fichier

@ -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),
}