ziwen 2 년 전
부모
커밋
7cb1f159d7
4개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 0
      controllers/micro_roadshow.go
  2. 2 2
      controllers/user.go
  3. 1 0
      models/article_comment.go
  4. 1 1
      models/micro_roadshow.go

+ 9 - 0
controllers/micro_roadshow.go

@@ -333,6 +333,15 @@ func (this *MicroRoadShowController) CommentAdd() {
 		item.IndustryId = req.Id
 	} else if sourceType == 2 {
 		item.ActivityId = req.Id
+	} else if sourceType == 3 {
+		item.VideoId = req.Id
+		microVideo, e := models.GetMicroRoadshowVideoById(req.Id)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(req.Id)
+			return
+		}
+		item.IndustryId = microVideo.IndustryId
 	}
 	_, err = models.AddArticleComment(&item)
 	if err != nil {

+ 2 - 2
controllers/user.go

@@ -1576,9 +1576,9 @@ func (this *UserController) CommnetList() {
 		if comment.ArticleId > 0 {
 			item.RedirectType = 1
 		} else if comment.IndustryId > 0 {
-			item.RedirectType = 2
-		} else if comment.ActivityId > 0 {
 			item.RedirectType = 3
+		} else if comment.ActivityId > 0 {
+			item.RedirectType = 2
 		}
 		resp.List = append(resp.List, &item)
 	}

+ 1 - 0
models/article_comment.go

@@ -10,6 +10,7 @@ type CygxArticleComment struct {
 	UserId      int       `description:"用户id"`
 	ArticleId   int       `description:"文章id"`
 	ActivityId  int       `description:"活动id"`
+	VideoId     int       `description:"视频id"`
 	IndustryId  int       `description:"产业id"`
 	CreateTime  time.Time `description:"创建时间"`
 	Mobile      string    `description:"手机号"`

+ 1 - 1
models/micro_roadshow.go

@@ -308,7 +308,7 @@ func GetMicroRoadshowVideoByIndustryId(industryId int) (item *MicroRoadshowVideo
 
 type AddVideoCommnetReq struct {
 	Id         int    `description:"活动或产业ID"`
-	SourceType int    `description:"视频来源: 1-微路演; 2-产业 (不传默认为1)"`
+	SourceType int    `description:"视频来源: 1-音频; 2-活动视频; 3-微路演视频 (不传默认为1)"`
 	Content    string `description:"内容"`
 	Title      string `description:"标题"`
 }