From 4a7f6915256a497ac70f46ac16b0a6bda01db111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 21 Dec 2020 18:18:21 +0800 Subject: [PATCH] aa --- business/jxstore/cms/job.go | 7 +++++++ business/model/job.go | 1 + 2 files changed, 8 insertions(+) diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 256eeacfc..4ebec612a 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -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 } diff --git a/business/model/job.go b/business/model/job.go index a4b0485ec..2a0a135ea 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -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"` }