xingzai 3 жил өмнө
parent
commit
e905e95208

+ 3 - 4
models/article_history_record_newpv.go

@@ -39,14 +39,13 @@ func GetNewArticleHistoryRecordNewpv(uid, articleId int, modifytime string) (ite
 func UpdateCygxArticleViewRecordNewpv(itemRep *CygxArticleHistoryRecordNewpv, stopTime int) (err error) {
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_article_history_record_newpv 
-			SET stop_time = stop_time + ` + strconv.Itoa(stopTime) + `
+			SET modify_time = NOW(), stop_time = stop_time + ` + strconv.Itoa(stopTime) + `
 			WHERE
 			article_id = ? 
-			AND user_id = ? 
-			AND modify_time = ? 
+			AND user_id = ?
 			AND out_type = 2
 			AND timestampdiff(MINUTE,modify_time,NOW()) < 10`
-	_, err = o.Raw(sql, itemRep.ArticleId, itemRep.UserId, itemRep.ModifyTime).Exec()
+	_, err = o.Raw(sql, itemRep.ArticleId, itemRep.UserId).Exec()
 
 	return
 }