xingzai 3 ani în urmă
părinte
comite
b158f1a09f

+ 9 - 6
controllers/article.go

@@ -617,7 +617,7 @@ func (this *ArticleController) AddStopTime() {
 					go models.AddArticleStopTime(historyRecord)
 				}
 
-				key := "CYGX_ARTICLE_PV" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
+				key := "CYGX_ARTICLE_PV" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid) + "_" + strconv.Itoa(user.CompanyId)
 				record := new(models.CygxArticleHistoryRecordNewpv)
 				record.UserId = uid
 				record.ArticleId = articleId
@@ -629,11 +629,14 @@ func (this *ArticleController) AddStopTime() {
 				record.CompanyName = user.CompanyName
 				record.StopTime = req.StopTime
 				record.OutType = req.OutType
-				if !utils.Rc.IsExist(key) {
-					//新增浏览记录
-					go models.AddCygxArticleViewRecordNewpv(record)
-				} else {
-					go models.UpdateCygxArticleViewRecordNewpv(record, req.StopTime)
+				//不统计本公司的阅读记录、正常退出的不做时间差统计
+				if user.CompanyId != 16 {
+					if !utils.Rc.IsExist(key) || req.OutType != 2 {
+						//新增浏览记录
+						go models.AddCygxArticleViewRecordNewpv(record)
+					} else {
+						go models.UpdateCygxArticleViewRecordNewpv(record, req.StopTime)
+					}
 				}
 				utils.Rc.Put(key, 1, 10*time.Minute)
 				models.ModifyReportLastViewTime(uid)

+ 1 - 0
controllers/home.go

@@ -132,6 +132,7 @@ func (this *HomeController) ListHome() {
 		if item.Pv > 999 {
 			list[i].Pv = 999
 		}
+		list[i].ImgUrlPc = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211206/UvMadc63MLZY6rnQZQgGZAFXkqwf.png"
 	}
 	resp.List = list
 	resp.Paging = page

+ 2 - 0
controllers/report.go

@@ -389,6 +389,7 @@ func (this *ReportController) List() {
 		if v.VideoUrl != "" {
 			list[k].IsHaveVideo = true
 		}
+		list[k].ImgUrlPc = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211206/UvMadc63MLZY6rnQZQgGZAFXkqwf.png"
 	}
 	resp.List = list
 	resp.Paging = page
@@ -934,6 +935,7 @@ func (this *ReportController) ReportList() {
 			list[k].IndustryName = industryName
 		}
 		resp.IndustryName = industryName
+		list[k].ImgUrlPc = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211206/UvMadc63MLZY6rnQZQgGZAFXkqwf.png"
 	}
 	resp.List = list
 	resp.Paging = page

+ 2 - 0
models/article.go

@@ -93,6 +93,7 @@ type HomeArticle struct {
 	ExpertBackground string `description:"专家背景"`
 	IsResearch       bool   `description:"是否属于研选"`
 	Pv               int    `description:"PV"`
+	ImgUrlPc         string `description:"图片链接"`
 }
 
 type ArticleDetail struct {
@@ -358,6 +359,7 @@ type ReportArticle struct {
 	Readnum          int    `description:"阅读数量"`
 	VideoUrl         string `description:"链接"`
 	IsHaveVideo      bool   `description:"是否含有音频文件"`
+	ImgUrlPc         string `description:"图片链接"`
 }
 
 func GetReportPermission(categoryName string) (item []*ChartPermission, err error) {

+ 1 - 0
models/article_history_record_newpv.go

@@ -44,6 +44,7 @@ func UpdateCygxArticleViewRecordNewpv(itemRep *CygxArticleHistoryRecordNewpv, st
 			article_id = ? 
 			AND user_id = ? 
 			AND modify_time = ? 
+			AND out_type = 2
 			AND timestampdiff(MINUTE,modify_time,NOW()) < 10`
 	_, err = o.Raw(sql, itemRep.ArticleId, itemRep.UserId, itemRep.ModifyTime).Exec()
 

+ 1 - 0
models/report.go

@@ -149,6 +149,7 @@ type ReportArticleWhichIndustrial struct {
 	Readnum      int    `description:"阅读数量"`
 	IsResearch   bool   `description:"是否属于研选"`
 	Pv           int    `description:"PV"`
+	ImgUrlPc     string `description:"图片链接"`
 }
 
 type ReportArticleWhichIndustrialRepList struct {