xingzai 2 yıl önce
ebeveyn
işleme
5944b73628
2 değiştirilmiş dosya ile 10 ekleme ve 1 silme
  1. 9 0
      models/micro_roadshow.go
  2. 1 1
      services/micro_roadshow.go

+ 9 - 0
models/micro_roadshow.go

@@ -168,6 +168,15 @@ func GetMicroRoadshowVideoByIndustryIdCount(industryId int) (count int, err erro
 	return
 }
 
+//GetMicroRoadshowVideoByVideoIdCount  根据视频ID查询产业视频是否存在
+func GetMicroRoadshowVideoByVideoIdCount(industryId int) (count int, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT COUNT(1) count
+			FROM cygx_micro_roadshow_video WHERE video_id = ? and publish_status = 1`
+	err = o.Raw(sql, industryId).QueryRow(&count)
+	return
+}
+
 // GetMicroRoadshowVideoList 获取已经发布的微路演视频
 func GetMicroRoadshowVideoList() (list []*MicroRoadshowVideo, err error) {
 	sql := `SELECT * FROM cygx_micro_roadshow_video WHERE  publish_status = 1`

+ 1 - 1
services/micro_roadshow.go

@@ -107,7 +107,7 @@ func GetindustryVideo(user *models.WxUserItem, industrialManagementId int) (indu
 
 //GetindustryVideoDetailById 通过视频ID获取视频详情
 func GetindustryVideoDetailById(user *models.WxUserItem, videoId int) (industryVideo *models.MicroVideoSimpleInfo, AuthInfo *models.UserPermissionAuthInfo, err error) {
-	total, e := models.GetMicroRoadshowVideoByIndustryIdCount(videoId)
+	total, e := models.GetMicroRoadshowVideoByVideoIdCount(videoId)
 	if e != nil {
 		err = errors.New("获取产业关联的视频失败,GetMicroRoadshowVideoByIndustryIdCount " + e.Error())
 		return