ziwen 2 years ago
parent
commit
2a21fdf693
2 changed files with 3 additions and 2 deletions
  1. 2 2
      models/report_selection_voice_history.go
  2. 1 0
      services/page_history_record.go

+ 2 - 2
models/report_selection_voice_history.go

@@ -29,14 +29,14 @@ func AddCygxReportSelectionVoiceHistory(item *CygxReportSelectionVoiceHistory) (
 
 func GetLastCygxReportSelectionVoiceHistory(articleId, userId int) (item *CygxReportSelectionVoiceHistory, err error) {
 	o := orm.NewOrm()
-	sql := ` SELECT * FROM cygx_report_selction_voice_history WHERE article_id=? AND user_id=? ORDER BY create_time DESC limit 1 `
+	sql := ` SELECT * FROM cygx_report_selection_voice_history WHERE article_id=? AND user_id=? ORDER BY create_time DESC limit 1 `
 	err = o.Raw(sql, articleId, userId).QueryRow(&item)
 	return
 }
 
 func UpdateLastCygxReportSelectionVoiceHistory(playSeconds string, lastId int) (err error) {
 	o := orm.NewOrm()
-	sql := ` UPDATE cygx_report_selction_voice_history SET play_seconds =? WHERE id=? `
+	sql := ` UPDATE cygx_report_selection_voice_history SET play_seconds =? WHERE id=? `
 	_, err = o.Raw(sql, playSeconds, lastId).Exec()
 	return
 }

+ 1 - 0
services/page_history_record.go

@@ -26,6 +26,7 @@ func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context)  {
 	if Ctx.Input.Method() == "POST" {
 		item.Parameter = string(Ctx.Input.RequestBody)
 	}
+	//fmt.Println("body:", string(Ctx.Input.RequestBody))
 	_, err := models.AddCygxPageHistoryRecord(item)
 	if err != nil {
 		fmt.Println(err)