|
@@ -22,7 +22,8 @@ type MicroRoadShowController struct {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -48,6 +49,7 @@ func (this *MicroRoadShowController) List() {
|
|
|
videoId, _ := this.GetInt("VideoId")
|
|
|
audioIds := this.GetString("AudioIds")
|
|
|
videoIds := this.GetString("VideoIds")
|
|
|
+ activityVideoIds := this.GetString("ActivityVideoIds")
|
|
|
activityVideoId, _ := this.GetInt("ActivityVideoId")
|
|
|
filter, _ := this.GetInt("Filter", 0)
|
|
|
|
|
@@ -59,7 +61,7 @@ func (this *MicroRoadShowController) List() {
|
|
|
}
|
|
|
|
|
|
|
|
|
- list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds)
|
|
|
+ list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds, activityVideoIds)
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
@@ -295,7 +297,7 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
if sourceType == 1 {
|
|
|
item.IndustryId = req.Id
|
|
|
} else if sourceType == 2 {
|
|
|
- item.ActivityId = req.Id
|
|
|
+ item.ActivityId = req.Id
|
|
|
}
|
|
|
_, err = models.AddArticleComment(&item)
|
|
|
if err != nil {
|
|
@@ -309,8 +311,8 @@ func (this *MicroRoadShowController) CommentAdd() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -351,7 +353,7 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
resp := new(models.ArticleCollectResp)
|
|
|
if count <= 0 {
|
|
|
item := new(models.CygxArticleCollect)
|
|
|
- item.ArticleId = req.Id
|
|
|
+ item.ActivityVoiceId = req.Id
|
|
|
item.UserId = uid
|
|
|
item.CreateTime = time.Now()
|
|
|
item.Mobile = user.Mobile
|
|
@@ -390,6 +392,60 @@ func (this *MicroRoadShowController) Collect() {
|
|
|
br.Success = true
|
|
|
br.Data = resp
|
|
|
} else if req.SourceType == 2 {
|
|
|
+ _, err := models.GetCygxActivityVideoById(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ count, err := models.GetActivityVideoCollectCount(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败!"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ArticleCollectResp)
|
|
|
+ if count <= 0 {
|
|
|
+ item := new(models.CygxArticleCollect)
|
|
|
+ item.ActivityVideoId = req.Id
|
|
|
+ item.UserId = uid
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+ item.Mobile = user.Mobile
|
|
|
+ item.Email = user.Email
|
|
|
+ item.CompanyId = user.CompanyId
|
|
|
+ item.CompanyName = user.CompanyName
|
|
|
+ item.RealName = user.RealName
|
|
|
+ _, err = models.AddCygxArticleCollect(item)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "收藏失败"
|
|
|
+ br.ErrMsg = "收藏失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "收藏成功"
|
|
|
+ resp.Status = 1
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ err = models.RemoveActivityVideoCollect(uid, req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "取消收藏失败"
|
|
|
+ br.ErrMsg = "取消收藏失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "已取消收藏"
|
|
|
+ resp.Status = 2
|
|
|
+ }
|
|
|
+ collectTotal, err := models.GetActivityVideoCollectUsersCount(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取数据失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.CollectCount = collectTotal
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Data = resp
|
|
|
+ } else if req.SourceType == 3 {
|
|
|
_, err := models.GetMicroRoadshowVideoById(req.Id)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|