diff --git a/business/model/dao/dao_job.go b/business/model/dao/dao_job.go index 3d0b617c8..c7ae1fd3e 100644 --- a/business/model/dao/dao_job.go +++ b/business/model/dao/dao_job.go @@ -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)