distance
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user