This commit is contained in:
苏尹岚
2020-11-16 17:10:44 +08:00
parent 641e05cfd7
commit 70f07549f6

View File

@@ -109,13 +109,13 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
}
if sortType != 0 {
if sortType == sortTypeDistance {
sql += ` ORDER distance`
sql += ` ORDER BY distance`
} else if sortType == -sortTypeDistance {
sql += ` ORDER distance DESC`
sql += ` ORDER BY distance DESC`
} else if sortType == sortTypeAvgPrice {
sql += ` ORDER a.avg_price`
sql += ` ORDER BY a.avg_price`
} else if sortType == -sortTypeAvgPrice {
sql += ` ORDER a.avg_price DESC`
sql += ` ORDER BY a.avg_price DESC`
}
}
sql += " LIMIT ? OFFSET ?"