|
@@ -325,54 +325,11 @@ func (this *MicroRoadShowController) VideoHistoryAdd() {
|
|
|
} else if sourceType == 2 {
|
|
|
//添加活动视频的播放记录
|
|
|
go services.AddActivityVideoHistory(user, sourceId, playSeconds)
|
|
|
- //if err != nil {
|
|
|
- // br.Msg = "更新失败"
|
|
|
- // br.ErrMsg = "更新失败,AddActivityVideoHistory Err:" + err.Error()
|
|
|
- // return
|
|
|
- //}
|
|
|
} else if sourceType == 3 {
|
|
|
- item := models.CygxMicroRoadshowVideoHistory{
|
|
|
- VideoId: sourceId,
|
|
|
- UserId: uid,
|
|
|
- Mobile: user.Mobile,
|
|
|
- Email: user.Email,
|
|
|
- CompanyId: user.CompanyId,
|
|
|
- CompanyName: user.CompanyName,
|
|
|
- RealName: user.RealName,
|
|
|
- SellerName: sellerName,
|
|
|
- PlaySeconds: strconv.Itoa(playSeconds),
|
|
|
- CreateTime: time.Now(),
|
|
|
- ModifyTime: time.Now(),
|
|
|
- }
|
|
|
- if playSeconds != 0 {
|
|
|
- lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(sourceId, user.UserId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- err = models.UpdateLastCygxActivityVideoHistory(strconv.Itoa(playSeconds), lastItem.Id)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "更新失败"
|
|
|
- br.ErrMsg = "更新失败,UpdateLastCygxActivityVideoHistory Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- err = models.AddCygxMicroRoadshowVideoHistory(&item)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- err = models.UpdateCygxActivityVideoCounts(sourceId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "更新失败"
|
|
|
- br.ErrMsg = "更新失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- go services.MicroRoadshowVideoUserRmind(user, sourceId)
|
|
|
+ //添加产业视频播放记录
|
|
|
+ go services.AddMicroRoadshowVideoRecord(user, sourceId, playSeconds)
|
|
|
} else if sourceType == 4 {
|
|
|
+ //问答系列音频播放记录
|
|
|
go services.AddAskserieVideoHistoryRecord(user, sourceId, playSeconds)
|
|
|
}
|
|
|
br.Ret = 200
|