|
@@ -1,6 +1,7 @@
|
|
|
package models
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"hongze/hongze_cygx/utils"
|
|
|
"rdluck_tools/orm"
|
|
|
"time"
|
|
@@ -23,6 +24,7 @@ func AddCygxArticleHistoryRecord(item *CygxArticleHistoryRecord) (lastId int64,
|
|
|
o := orm.NewOrm()
|
|
|
o.Begin()
|
|
|
defer func() {
|
|
|
+ fmt.Println(err)
|
|
|
if err == nil {
|
|
|
o.Commit()
|
|
|
} else {
|
|
@@ -32,7 +34,10 @@ func AddCygxArticleHistoryRecord(item *CygxArticleHistoryRecord) (lastId int64,
|
|
|
//var count int
|
|
|
//sql := `SELECT COUNT(1) AS count FROM cygx_article_history_record WHERE user_id=? AND article_id=? `
|
|
|
//err = o.Raw(sql, item.UserId, item.ArticleId).QueryRow(&count)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+
|
|
|
+ sql := `UPDATE wx_user SET report_last_view_time=NOW() WHERE user_id=?`
|
|
|
+ _, err = o.Raw(sql, item.UserId).Exec()
|
|
|
+ if err != nil {
|
|
|
return
|
|
|
}
|
|
|
//if count > 0 {
|