This commit is contained in:
苏尹岚
2020-12-23 11:40:12 +08:00
parent 25671ad532
commit 5fee02bfcd

View File

@@ -71,16 +71,13 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
FROM job a
JOIN job_category b ON b.id = a.job_category_id AND b.deleted_at = ?
WHERE a.deleted_at = ?
AND (a.job_city_code = ? OR a.job_city_code = ?)
`
if cityCode == 0 {
if len(cityCodes) > 0 {
cityCode = cityCodes[0]
} else {
cityCode = 510100
}
if cityCode > 0 {
sql += " AND (a.job_city_code = ? OR a.job_city_code = ?)"
sqlParams = append(sqlParams, cityCode, model.JobCountrywideCode)
}
sqlParams = append(sqlParams, lng, lat, utils.DefaultTimeValue, utils.DefaultTimeValue, cityCode, model.JobCountrywideCode)
sqlParams = append(sqlParams, lng, lat, utils.DefaultTimeValue, utils.DefaultTimeValue)
if len(userIDs) > 0 {
sql += ` AND a.user_id IN (` + GenQuestionMarks(len(userIDs)) + `)`
sqlParams = append(sqlParams, userIDs)