fixed order direction on columns
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2020-09-06 16:28:01 +02:00
parent 7cb2601b3b
commit 357ae512da

View File

@ -113,9 +113,9 @@ func BuildQuery(config config.Config, qrzdt QrzDatatableInput) (qrz []qrz.Qrz, e
return nil, err
}
if orderdir == "DESC" {
if orderdir == "desc" {
err = config.Db.Where(searchstatement).Limit(limit, offset).Desc(ordercol...).Select(selectstatement).Find(&qrz)
} else if orderdir == "ASC" {
} else if orderdir == "asc" {
err = config.Db.Where(searchstatement).Limit(limit, offset).Asc(ordercol...).Select(selectstatement).Find(&qrz)
} else {
err = config.Db.Where(searchstatement).Limit(limit, offset).Asc("qrz").Select(selectstatement).Find(&qrz)