Explorar o código

Merge branch 'cygx/7.6' into debug

ziwen %!s(int64=2) %!d(string=hai) anos
pai
achega
707ddedbcf
Modificáronse 2 ficheiros con 9 adicións e 2 borrados
  1. 2 2
      controllers/micro_roadshow.go
  2. 7 0
      models/micro_roadshow.go

+ 2 - 2
controllers/micro_roadshow.go

@@ -178,10 +178,10 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
 			br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
 			return
 		}
-		err = models.UpdateLastCygxActivityVoiceHistory(playSeconds, lastItem.Id)
+		err = models.UpdateLastCygxActivityVideoHistory(playSeconds, lastItem.Id)
 		if err != nil {
 			br.Msg = "更新失败"
-			br.ErrMsg = "更新失败,UpdateLastCygxActivityVoiceHistory Err:" + err.Error()
+			br.ErrMsg = "更新失败,UpdateLastCygxActivityVideoHistory Err:" + err.Error()
 			return
 		}
 	} else {

+ 7 - 0
models/micro_roadshow.go

@@ -221,4 +221,11 @@ func GetHomeNewestListUnionCount(condition string, pars []interface{}) (count in
 			) z `
 	err = o.Raw(sql, pars).QueryRow(&count)
 	return
+}
+
+func UpdateLastCygxActivityVideoHistory(playSeconds string, lastId int) (err error) {
+	o := orm.NewOrm()
+	sql := ` UPDATE cygx_micro_roadshow_video_history SET play_seconds =? WHERE id=? `
+	_, err = o.Raw(sql, playSeconds, lastId).Exec()
+	return
 }