diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 350d29450..dec540d3a 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -78,6 +78,7 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e return errCode, fmt.Errorf("一件代发任务请输入商品价格!") } job.CashbackType = model.JobCashbackPrice + job.LimitCountType = model.JobLimitCountTypeNoLimit default: return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID) } diff --git a/business/model/dao/dao_job.go b/business/model/dao/dao_job.go index 5e2315de1..5a3e06f0c 100644 --- a/business/model/dao/dao_job.go +++ b/business/model/dao/dao_job.go @@ -64,7 +64,7 @@ func GetJobImgs(db *DaoDB, jobID int) (jobImgs []*model.JobImg, err error) { func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types, cityCodes []int, includeStep bool, fromTime, toTime time.Time, lng, lat float64, cityCode, span int, keyword string, sortType, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) { var ( jobs []*GetJobsResult - sqlParams = []interface{}{} + sqlParams = []interface{}{lng, lat, utils.DefaultTimeValue, utils.DefaultTimeValue} ) sql := ` SELECT SQL_CALC_FOUND_ROWS a.*, b.name, getDistance(?, ?, CAST(a.lng AS DECIMAL(15,6))/1000000, CAST(a.lat AS DECIMAL(15,6))/1000000) distance @@ -76,7 +76,6 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types 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) if len(userIDs) > 0 { sql += ` AND a.user_id IN (` + GenQuestionMarks(len(userIDs)) + `)` sqlParams = append(sqlParams, userIDs)