This commit is contained in:
苏尹岚
2020-11-02 18:25:25 +08:00
parent ca819b108c
commit 8ab2af4f1c
3 changed files with 29 additions and 4 deletions

View File

@@ -196,6 +196,17 @@ func GetJobs(ctx *jxcontext.Context, userIDs []string, categoryIDs, statuss, ven
return dao.GetJobs(dao.GetDB(), userIDs, categoryIDs, statuss, vendorIDs, []int{model.JobTypeNormal}, includeStep, utils.Str2Time(fromTime), utils.Str2Time(toTime), pageSize, offset)
}
func GetJobDetail(ctx *jxcontext.Context, jobID int, lng, lat float64) (job *dao.GetJobsResult, err error) {
var (
db = dao.GetDB()
)
job, err = dao.GetJobDetail(db, jobID)
if job.Lng != 0 && job.Lat != 0 {
job.Distance = jxutils.EarthDistance(lng, lat, jxutils.IntCoordinate2Standard(job.Lng), jxutils.IntCoordinate2Standard(job.Lat))
}
return job, err
}
func AcceptJob(ctx *jxcontext.Context, jobID int) (errCode string, err error) {
var (
db = dao.GetDB()