getjobs
This commit is contained in:
@@ -85,8 +85,14 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
|
|||||||
sqlParams = append(sqlParams, toTime)
|
sqlParams = append(sqlParams, toTime)
|
||||||
}
|
}
|
||||||
if sortType != 0 {
|
if sortType != 0 {
|
||||||
if sortType == sortTypeDistance || sortType == -sortTypeDistance {
|
if sortType == sortTypeDistance {
|
||||||
sql += ` ORDER distance`
|
sql += ` ORDER distance`
|
||||||
|
} else if sortType == -sortTypeDistance {
|
||||||
|
sql += ` ORDER distance DESC`
|
||||||
|
} else if sortType == sortTypeAvgPrice {
|
||||||
|
sql += ` ORDER a.avg_price`
|
||||||
|
} else if sortType == -sortTypeAvgPrice {
|
||||||
|
sql += ` ORDER a.avg_price DESC`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql += " LIMIT ? OFFSET ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
|
|||||||
Reference in New Issue
Block a user