ziwen 2 ani în urmă
părinte
comite
023c4fd549

+ 3 - 3
controllers/activity.go

@@ -4925,18 +4925,18 @@ func (this *ActivityCoAntroller) ActivityVoiceHistoryAdd() {
 		CompanyName: user.CompanyName,
 		RealName:    user.RealName,
 		SellerName:  sellerName,
-		PlaySeconds: playSeconds,
+		PlaySeconds: strconv.Itoa(req.PlaySeconds),
 		ModifyTime:  time.Now(),
 	}
 
-	if playSeconds != ""{
+	if playSeconds != 0 {
 		lastItem, err := models.GetLastCygxActivityVoiceHistory(activityId, user.UserId)
 		if err != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = "操作失败,GetLastCygxActivityVoiceHistory Err:" + err.Error()
 			return
 		}
-		err = models.UpdateLastCygxActivityVoiceHistory(playSeconds, lastItem.Id)
+		err = models.UpdateLastCygxActivityVoiceHistory(strconv.Itoa(req.PlaySeconds), lastItem.Id)
 		if err != nil {
 			br.Msg = "更新失败"
 			br.ErrMsg = "更新失败,UpdateLastCygxActivityVoiceHistory Err:" + err.Error()

+ 4 - 3
controllers/micro_roadshow.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
+	"strconv"
 	"time"
 )
 
@@ -113,19 +114,19 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
 		CompanyName: user.CompanyName,
 		RealName:    user.RealName,
 		SellerName:  sellerName,
-		PlaySeconds: playSeconds,
+		PlaySeconds: strconv.Itoa(playSeconds),
 		CreateTime:  time.Now(),
 		ModifyTime:  time.Now(),
 	}
 
-	if playSeconds != "" {
+	if playSeconds != 0 {
 		lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(videoId, user.UserId)
 		if err != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
 			return
 		}
-		err = models.UpdateLastCygxActivityVideoHistory(playSeconds, lastItem.Id)
+		err = models.UpdateLastCygxActivityVideoHistory(strconv.Itoa(playSeconds), lastItem.Id)
 		if err != nil {
 			br.Msg = "更新失败"
 			br.ErrMsg = "更新失败,UpdateLastCygxActivityVideoHistory Err:" + err.Error()

+ 1 - 1
models/activity.go

@@ -75,7 +75,7 @@ type Activity struct {
 }
 type ActivityIdRep struct {
 	ActivityId int `description:"活动id"`
-	PlaySeconds string `description:"播放时长"`
+	PlaySeconds int `description:"播放时长"`
 }
 
 type ActivitySingnupRep struct {

+ 1 - 1
models/micro_roadshow.go

@@ -91,7 +91,7 @@ func GetMicroRoadShowVideoPageList(startSize, pageSize int, condition string, pa
 
 type AddVideoHistoryReq struct {
 	VideoId int  `description:"视频ID"`
-	PlaySeconds string `description:"播放时长"`
+	PlaySeconds int `description:"播放时长"`
 }
 
 type CygxMicroRoadshowVideoHistory struct {