xingzai 3 лет назад
Родитель
Сommit
8612c58479

+ 6 - 0
controllers/article.go

@@ -584,6 +584,7 @@ func (this *ArticleController) AddStopTime() {
 	articleId := req.ArticleId
 	stopTime := req.StopTime
 	outType := req.OutType
+	source := req.Source
 	if articleId <= 0 {
 		br.Msg = "参数错误"
 		br.ErrMsg = "参数错误"
@@ -595,6 +596,10 @@ func (this *ArticleController) AddStopTime() {
 	if outType != 2 {
 		outType = 1
 	}
+	if source != "PC" {
+		source = "MOBILE"
+	}
+
 	detail := new(models.ArticleDetail)
 	hasPermission := 0
 	hasFree := 0
@@ -679,6 +684,7 @@ func (this *ArticleController) AddStopTime() {
 					record.CompanyName = user.CompanyName
 					record.StopTime = stopTime
 					record.OutType = outType
+					record.Source = source
 					if !utils.Rc.IsExist(key) || outType != 2 {
 						//新增浏览记录
 						go models.AddCygxArticleViewRecordNewpv(record)

+ 4 - 3
models/article_history_record.go

@@ -65,9 +65,10 @@ func GetUserToArticleCount(uid, articleId int) (count int, err error) {
 }
 
 type AddStopTimeRep struct {
-	ArticleId int `description:"文章ID"`
-	StopTime  int `description:"停留时间"`
-	OutType   int `description:"退出方式,1正常退出,2强制关闭"`
+	ArticleId int    `description:"文章ID"`
+	StopTime  int    `description:"停留时间"`
+	OutType   int    `description:"退出方式,1正常退出,2强制关闭"`
+	Source    string `description:"来源,MOBILE:手机端,PC:电脑端"`
 }
 
 type AddStopTimeNewRep struct {

+ 1 - 0
models/article_history_record_newpv.go

@@ -18,6 +18,7 @@ type CygxArticleHistoryRecordNewpv struct {
 	CompanyName string `description:"公司名称"`
 	StopTime    int    `description:"停留时间"`
 	OutType     int    `description:"退出方式,1正常退出,2强制关闭"`
+	Source      string `description:"来源,MOBILE:手机端,PC:电脑端"`
 }
 
 //添加收藏信息