From 4f5c1a8f2b364f4cf8b95bb8424877411324fe14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 17 Dec 2020 16:48:19 +0800 Subject: [PATCH] a --- business/jxstore/cms/job.go | 10 ++++++++-- business/model/dao/dao_job.go | 12 ++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index b78f423d9..bf09bb2c1 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -1129,11 +1129,17 @@ func RefreshJobSpan(ctx *jxcontext.Context) (err error) { job.ID = jobSpan.JobID if err = dao.GetEntity(db, job); err == nil { if jobSpan.SpanType == model.JobSpanTop { - + job.TopSeq = 0 + job.JobSpanTop = 0 + dao.UpdateEntity(db, job, "TopSeq", "JobSpanTop") } else { - + job.RecmdSeq = 0 + job.JobSpanRecmd = 0 + dao.UpdateEntity(db, job, "RecmdSeq", "JobSpanRecmd") } } + jobSpan.DeletedAt = time.Now() + dao.UpdateEntity(db, jobSpan, "DeletedAt") } return retVal, err }, jobSpans) diff --git a/business/model/dao/dao_job.go b/business/model/dao/dao_job.go index e1e3e7f94..b8c4757b6 100644 --- a/business/model/dao/dao_job.go +++ b/business/model/dao/dao_job.go @@ -111,17 +111,17 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types } if sortType != 0 { if sortType == sortTypeDistance { - sql += ` ORDER BY distance` + sql += ` ORDER BY job_span_top, top_seq, distance` } else if sortType == -sortTypeDistance { - sql += ` ORDER BY distance DESC` + sql += ` ORDER BY job_span_top, top_seq, distance DESC` } else if sortType == sortTypeAvgPrice { - sql += ` ORDER BY a.avg_price` + sql += ` ORDER BY job_span_top, top_seq, a.avg_price` } else if sortType == -sortTypeAvgPrice { - sql += ` ORDER BY a.avg_price DESC` + sql += ` ORDER BY job_span_top, top_seq, a.avg_price DESC` } else if sortType == sortTypeTime { - sql += ` ORDER BY a.created_at` + sql += ` ORDER BY job_span_top, top_seq, a.created_at` } else if sortType == -sortTypeTime { - sql += ` ORDER BY a.created_at DESC` + sql += ` ORDER BY job_span_top, top_seq, a.created_at DESC` } } sql += " LIMIT ? OFFSET ?"