a
This commit is contained in:
@@ -1129,11 +1129,17 @@ func RefreshJobSpan(ctx *jxcontext.Context) (err error) {
|
|||||||
job.ID = jobSpan.JobID
|
job.ID = jobSpan.JobID
|
||||||
if err = dao.GetEntity(db, job); err == nil {
|
if err = dao.GetEntity(db, job); err == nil {
|
||||||
if jobSpan.SpanType == model.JobSpanTop {
|
if jobSpan.SpanType == model.JobSpanTop {
|
||||||
|
job.TopSeq = 0
|
||||||
|
job.JobSpanTop = 0
|
||||||
|
dao.UpdateEntity(db, job, "TopSeq", "JobSpanTop")
|
||||||
} else {
|
} 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
|
return retVal, err
|
||||||
}, jobSpans)
|
}, jobSpans)
|
||||||
|
|||||||
@@ -111,17 +111,17 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
|
|||||||
}
|
}
|
||||||
if sortType != 0 {
|
if sortType != 0 {
|
||||||
if sortType == sortTypeDistance {
|
if sortType == sortTypeDistance {
|
||||||
sql += ` ORDER BY distance`
|
sql += ` ORDER BY job_span_top, top_seq, distance`
|
||||||
} else if sortType == -sortTypeDistance {
|
} else if sortType == -sortTypeDistance {
|
||||||
sql += ` ORDER BY distance DESC`
|
sql += ` ORDER BY job_span_top, top_seq, distance DESC`
|
||||||
} else if sortType == sortTypeAvgPrice {
|
} 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 {
|
} 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 {
|
} 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 {
|
} 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 ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
|
|||||||
Reference in New Issue
Block a user