From 5fee02bfcd37c713e898101b1b403e15d983db1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 23 Dec 2020 11:40:12 +0800 Subject: [PATCH] aa --- business/model/dao/dao_job.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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)