This commit is contained in:
苏尹岚
2020-12-21 18:18:21 +08:00
parent 92f0cca62d
commit 4a7f691525
2 changed files with 8 additions and 0 deletions

View File

@@ -250,6 +250,13 @@ func GetJobDetail(ctx *jxcontext.Context, jobID int, lng, lat float64) (job *dao
if job.Lng != 0 && job.Lat != 0 {
job.Distance = jxutils.EarthDistance(lng, lat, jxutils.IntCoordinate2Standard(job.Lng), jxutils.IntCoordinate2Standard(job.Lat))
}
utils.CallFuncAsync(func() {
job2 := &model.Job{}
job2.ID = job.ID
dao.GetEntity(db, job2)
job2.BrowseCount++
dao.UpdateEntity(db, job2, "BrowseCount")
})
return job, err
}

View File

@@ -89,6 +89,7 @@ type Job struct {
StoreURL string `orm:"column(store_url)" json:"storeURL"` //门店链接
SkuURL string `orm:"column(sku_url)" json:"skuURL"` //商品优惠券链接
Type int `json:"type"` //任务类型0为普通任务1为特殊任务
BrowseCount int `json:"browseCount"` //任务浏览量,点一下加一下
JobSteps []*JobStep `orm:"-" json:"jobSteps"`
JobImgs []*JobImg `orm:"-" json:"jobImgs"`
}