a
This commit is contained in:
@@ -111,17 +111,17 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
|
|||||||
}
|
}
|
||||||
if sortType != 0 {
|
if sortType != 0 {
|
||||||
if sortType == sortTypeDistance {
|
if sortType == sortTypeDistance {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, distance`
|
sql += ` ORDER BY job_span_top DESC, top_seq, distance`
|
||||||
} else if sortType == -sortTypeDistance {
|
} else if sortType == -sortTypeDistance {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, distance DESC`
|
sql += ` ORDER BY job_span_top DESC, top_seq, distance DESC`
|
||||||
} else if sortType == sortTypeAvgPrice {
|
} else if sortType == sortTypeAvgPrice {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, a.avg_price`
|
sql += ` ORDER BY job_span_top DESC, top_seq, a.avg_price`
|
||||||
} else if sortType == -sortTypeAvgPrice {
|
} else if sortType == -sortTypeAvgPrice {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, a.avg_price DESC`
|
sql += ` ORDER BY job_span_top DESC, top_seq, a.avg_price DESC`
|
||||||
} else if sortType == sortTypeTime {
|
} else if sortType == sortTypeTime {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, a.created_at`
|
sql += ` ORDER BY job_span_top DESC, top_seq, a.created_at`
|
||||||
} else if sortType == -sortTypeTime {
|
} else if sortType == -sortTypeTime {
|
||||||
sql += ` ORDER BY job_span_top, top_seq, a.created_at DESC`
|
sql += ` ORDER BY job_span_top DESC, top_seq, a.created_at DESC`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql += " LIMIT ? OFFSET ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
|
|||||||
Reference in New Issue
Block a user