micro_roadshow.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. "hongze/hongze_clpt/utils"
  6. "time"
  7. )
  8. // MicroRoadShowListResp 微路演列表响应体
  9. type MicroRoadShowListResp struct {
  10. Paging *paging.PagingItem
  11. List []*MicroRoadShowPageList
  12. }
  13. type CygxMicroRoadshowVideo struct {
  14. VideoId int `orm:"column(video_id);pk"description:"微路演视频id"`
  15. VideoName string `description:"视频名称"`
  16. ChartPermissionId int `description:"行业Id"`
  17. ChartPermissionName string `description:"行业名称"`
  18. IndustryId int `description:"产业id"`
  19. IndustryName string `description:"产业名称"`
  20. PublishStatus int `description:"发布状态 1发布 0没有"`
  21. ModifyDate string `description:"更新时间"`
  22. PublishDate time.Time `description:"发布时间"`
  23. VideoDuration string `description:"视频时长"`
  24. VideoCounts int `description:"播放量"`
  25. VideoUrl string `description:"视频地址"`
  26. CreateTime string `description:"创建时间"`
  27. ImgUrl string `description:"视频封面图"`
  28. ShareImgUrl string `description:"视频分享图"`
  29. DetailImgUrl string `description:"产业详情页背景图"`
  30. CommentNum int `description:"留言总数"`
  31. IsSendWxMsg int `description:"是否推送过微信模板消息,1是,0:否"`
  32. }
  33. // MicroRoadShowPageList 微路演列表
  34. type MicroRoadShowPageList struct {
  35. Id int `description:"音视频ID"`
  36. SourceId int `description:"资源ID"`
  37. Title string `description:"标题"`
  38. ResourceUrl string `description:"链接"`
  39. Type int `description:"类型: 1-音频; 2-活动视频; 3-产业视频 、 4-系列问答视频"`
  40. PublishTime string `description:"发布时间"`
  41. BackgroundImg string `description:"背景图"`
  42. ShareImg string `description:"分享封面图"`
  43. ChartPermissionId int `description:"行业ID"`
  44. ChartPermissionName string `description:"行业名称"`
  45. IndustryName string `description:"产业名称"`
  46. PlaySeconds string `description:"音视频时长"`
  47. ActivityId int `description:"活动ID"`
  48. IsCollect bool `description:"是否收藏"`
  49. IndustrialManagementId int `description:"产业ID"`
  50. CreateTime string `description:"视频创建时间"`
  51. CollectTime time.Time `description:"收藏时间"`
  52. AuthInfo *UserPermissionAuthInfo
  53. }
  54. func GetMicroRoadshowVideoByVideoId(videoId int) (item *CygxMicroRoadshowVideo, err error) {
  55. o := orm.NewOrm()
  56. sql := `SELECT * from cygx_micro_roadshow_video where video_id = ? `
  57. err = o.Raw(sql, videoId).QueryRow(&item)
  58. return
  59. }
  60. type AddVideoHistoryReq struct {
  61. SourceId int `description:"资源ID"`
  62. PlaySeconds int `description:"播放时长"`
  63. SourceType int `description:"音视频来源: 1-活动音频; 2-活动视频; 3-产业视频; 4-系列问答"`
  64. }
  65. type CygxMicroRoadshowVideoHistory struct {
  66. Id int `orm:"column(id);pk"description:"微路演视频浏览记录表id"`
  67. VideoId int `description:"微路演视频id"`
  68. UserId int `description:"用户id"`
  69. Mobile string `description:"手机号"`
  70. Email string `description:"邮箱"`
  71. CompanyId int `description:"公司Id"`
  72. CompanyName string `description:"公司名称"`
  73. RealName string `description:"用户实际名称"`
  74. SellerName string `description:"所属销售"`
  75. PlaySeconds string `description:"播放时间 单位s"`
  76. CreateTime time.Time `description:"视频创建时间"`
  77. ModifyTime time.Time `description:"视频修改时间"`
  78. }
  79. func GetLastCygxMicroRoadshowVideoHistory(videoId, userId int) (item *CygxMicroRoadshowVideoHistory, err error) {
  80. o := orm.NewOrm()
  81. sql := ` SELECT * FROM cygx_micro_roadshow_video_history WHERE video_id=? AND user_id=? ORDER BY create_time DESC limit 1 `
  82. err = o.Raw(sql, videoId, userId).QueryRow(&item)
  83. return
  84. }
  85. func AddCygxMicroRoadshowVideoHistory(item *CygxMicroRoadshowVideoHistory) (err error) {
  86. o := orm.NewOrm()
  87. _, err = o.Insert(item)
  88. return
  89. }
  90. // MicroAudioUnionList 微路演音频联合列表
  91. type MicroAudioUnionList struct {
  92. Id int `description:"音视频ID"`
  93. AudioTitle string `description:"标题"`
  94. AudioResourceUrl string `description:"链接"`
  95. AudioType int `description:"类型: 1-音频; 2-视频"`
  96. AudioPublishTime string `description:"发布时间"`
  97. AudioImgUrl string `description:"背景图"`
  98. AudioShareImg string `description:"分享图"`
  99. AudioChartPermissionId int `description:"行业ID"`
  100. AudioChartPermissionName string `description:"行业名称"`
  101. AudioPlaySeconds string `description:"音视频时长"`
  102. AudioActivityId int `description:"活动ID"`
  103. AuthInfo *UserPermissionAuthInfo
  104. }
  105. // HomeNewestUnionList 首页最新纪要-音频联合查询结果
  106. type HomeNewestUnionList struct {
  107. ArticleId int `description:"文章id"`
  108. Title string `description:"标题"`
  109. TitleEn string `description:"英文标题 "`
  110. UpdateFrequency string `description:"更新周期"`
  111. CreateDate string `description:"创建时间"`
  112. PublishDate string `description:"发布时间"`
  113. Body string `description:"内容"`
  114. BodyHtml string `description:"内容带有HTML标签"`
  115. Abstract string `description:"摘要"`
  116. CategoryName string `description:"一级分类"`
  117. SubCategoryName string `description:"二级分类"`
  118. ExpertBackground string `description:"专家背景"`
  119. IsResearch bool `description:"是否属于研选"`
  120. Pv int `description:"PV"`
  121. ImgUrlPc string `description:"图片链接"`
  122. CategoryId string `description:"文章分类"`
  123. HttpUrl string `description:"文章链接跳转地址"`
  124. IsNeedJump bool `description:"是否需要跳转链接地址"`
  125. Source int `description:"来源 1:文章, 2:图表"`
  126. Annotation string `description:"核心观点"`
  127. HomeType int `description:"数据类型:0-纪要(默认); 1-微路演音频"`
  128. MicroAudioUnionList
  129. }
  130. func UpdateLastCygxActivityVideoHistory(playSeconds string, lastId int) (err error) {
  131. o := orm.NewOrm()
  132. sql := ` UPDATE cygx_micro_roadshow_video_history SET play_seconds =? WHERE id=? `
  133. _, err = o.Raw(sql, playSeconds, lastId).Exec()
  134. return
  135. }
  136. // MicroRoadshowVideo 微路演视频
  137. type MicroRoadshowVideo struct {
  138. VideoId int `orm:"column(video_id);pk" description:"视频ID"`
  139. VideoName string `description:"视频标题"`
  140. ChartPermissionId int `description:"行业ID"`
  141. ChartPermissionName string `description:"行业名称"`
  142. IndustryId int `description:"产业ID"`
  143. IndustryName string `description:"产业名称"`
  144. PublishStatus int `description:"发布状态:0-未发布;1-已发布"`
  145. ModifyDate time.Time `description:"更新时间"`
  146. PublishDate time.Time `description:"发布时间"`
  147. VideoCounts int `description:"视频播放量"`
  148. VideoDuration int `description:"视频时长"`
  149. VideoUrl string `description:"视频地址"`
  150. CreateTime time.Time `description:"创建时间"`
  151. ImgUrl string `description:"背景图链接"`
  152. DetailImgUrl string `description:"产业详情页背景图"`
  153. }
  154. // GetMicroRoadshowVideoById 主键获取微路演视频
  155. func GetMicroRoadshowVideoById(videoId int) (item *MicroRoadshowVideo, err error) {
  156. sql := `SELECT * FROM cygx_micro_roadshow_video WHERE video_id = ? LIMIT 1`
  157. err = orm.NewOrm().Raw(sql, videoId).QueryRow(&item)
  158. return
  159. }
  160. func UpdateCygxActivityVideoCounts(videoId int) (err error) {
  161. sql := `UPDATE cygx_micro_roadshow_video SET video_counts = video_counts+1 WHERE video_id = ? `
  162. o := orm.NewOrm()
  163. _, err = o.Raw(sql, videoId).Exec()
  164. return
  165. }
  166. // GetMicroRoadshowVideoByIndustryIds 根据行业ID查询产业视频列表
  167. func GetMicroRoadshowVideoByIndustryIds(industrialIdArr []int) (list []*MicroRoadshowVideo, err error) {
  168. sql := `SELECT * FROM cygx_micro_roadshow_video WHERE industry_id in (` + utils.GetOrmInReplace(len(industrialIdArr)) + `) `
  169. _, err = orm.NewOrm().Raw(sql, industrialIdArr).QueryRows(&list)
  170. return
  171. }
  172. // GetMicroRoadshowVideoListBycondition 根据搜索条件获取搜索列表
  173. func GetMicroRoadshowVideoListBycondition(condition string, pars []interface{}, startSize, pageSize int) (list []*MicroRoadshowVideo, err error) {
  174. sql := `SELECT * FROM cygx_micro_roadshow_video WHERE 1 =1 `
  175. if condition != "" {
  176. sql += condition
  177. }
  178. sql += ` LIMIT ?,? `
  179. _, err = orm.NewOrm().Raw(sql, pars, startSize, pageSize).QueryRows(&list)
  180. return
  181. }
  182. // GetMicroRoadshowVideoByIndustryId 根据行业ID查询产业视频列表
  183. func GetMicroRoadshowVideoByIndustryId(industryId int) (item *MicroRoadshowVideo, err error) {
  184. sql := `SELECT * FROM cygx_micro_roadshow_video WHERE industry_id = ? and publish_status = 1`
  185. err = orm.NewOrm().Raw(sql, industryId).QueryRow(&item)
  186. return
  187. }
  188. // GetMicroRoadshowVideoByIndustryIdCount 根据行业ID查询产业视频是否存在
  189. func GetMicroRoadshowVideoByIndustryIdCount(industryId int) (count int, err error) {
  190. o := orm.NewOrm()
  191. sql := `SELECT COUNT(1) count
  192. FROM cygx_micro_roadshow_video WHERE industry_id = ? and publish_status = 1`
  193. err = o.Raw(sql, industryId).QueryRow(&count)
  194. return
  195. }
  196. // GetMicroRoadshowVideoByVideoIdCount 根据视频ID查询产业视频是否存在
  197. func GetMicroRoadshowVideoByVideoIdCount(industryId int) (count int, err error) {
  198. o := orm.NewOrm()
  199. sql := `SELECT COUNT(1) count
  200. FROM cygx_micro_roadshow_video WHERE video_id = ? and publish_status = 1`
  201. err = o.Raw(sql, industryId).QueryRow(&count)
  202. return
  203. }
  204. // GetMicroRoadshowVideoList 获取已经发布的微路演视频
  205. func GetMicroRoadshowVideoList() (list []*MicroRoadshowVideo, err error) {
  206. sql := `SELECT * FROM cygx_micro_roadshow_video WHERE publish_status = 1`
  207. _, err = orm.NewOrm().Raw(sql).QueryRows(&list)
  208. return
  209. }
  210. // GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
  211. func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}, audioId, videoId, activityVideoId, filter int) (total int, list []*MicroRoadShowPageList, err error) {
  212. o := orm.NewOrm()
  213. var sql string
  214. //if audioId+activityVideoId == 0 && filter != 2 {
  215. sql += `SELECT
  216. video_id AS id,
  217. video_name AS title,
  218. video_url AS resource_url,
  219. 3 AS type,
  220. publish_date AS publish_time,
  221. chart_permission_id,
  222. chart_permission_name,
  223. video_duration AS play_seconds,
  224. img_url AS background_img,
  225. industry_name,
  226. share_img_url AS share_img,
  227. industry_id AS industrial_management_id,
  228. "" as activity_id
  229. FROM
  230. cygx_micro_roadshow_video
  231. WHERE
  232. publish_status = 1 `
  233. if condition != `` {
  234. sql += condition
  235. }
  236. //}
  237. //if audioId+videoId+activityVideoId == 0 && filter != 2 {
  238. sql += ` UNION ALL `
  239. //}
  240. //if audioId+videoId == 0 && filter != 2 {
  241. sql += `
  242. SELECT
  243. video_id AS id,
  244. video_name AS title,
  245. video_url AS resource_url,
  246. 2 AS type,
  247. art.activity_time as publish_time,
  248. art.chart_permission_id,
  249. art.chart_permission_name,
  250. "" AS play_seconds,
  251. v.background_img,
  252. "" AS industry_name,
  253. v.share_img,
  254. 0 AS industrial_management_id,
  255. v.activity_id
  256. FROM
  257. cygx_activity_video as v
  258. INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1 `
  259. if conditionAct != `` {
  260. sql += conditionAct
  261. }
  262. //}
  263. //if audioId+videoId+activityVideoId == 0 && filter == 0 {
  264. sql += ` UNION ALL `
  265. //}
  266. //if videoId+activityVideoId == 0 && filter != 1 {
  267. sql += `
  268. SELECT
  269. a.activity_voice_id AS id,
  270. a.voice_name AS title,
  271. a.voice_url AS resource_url,
  272. 1 AS type,
  273. b.activity_time AS publish_time,
  274. b.chart_permission_id,
  275. b.chart_permission_name,
  276. a.voice_play_seconds AS play_seconds,
  277. a.background_img,
  278. "" AS industry_name,
  279. a.share_img,
  280. 0 AS industrial_management_id,
  281. a.activity_id
  282. FROM
  283. cygx_activity_voice AS a
  284. JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 `
  285. if conditionAudio != `` {
  286. sql += conditionAudio
  287. }
  288. //}
  289. sql += ` ORDER BY publish_time DESC`
  290. totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
  291. err = o.Raw(totalSql, pars, parsAct, parsAudio).QueryRow(&total)
  292. if err != nil {
  293. return
  294. }
  295. sql += ` LIMIT ?,?`
  296. _, err = o.Raw(sql, pars, parsAct, parsAudio, startSize, pageSize).QueryRows(&list)
  297. return
  298. }
  299. // GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
  300. func GetMicroRoadShowVideoPageListV12(startSize, pageSize int, audioAct string, audioActPars []interface{}, videoAct string, videoActPars []interface{}, videoMico string, videoMicoPars []interface{}, conditionAskserie string, askseriePars []interface{}) (total int, list []*MicroRoadShowPageList, err error) {
  301. o := orm.NewOrm()
  302. var sql string
  303. //活动音频1
  304. sql += `
  305. SELECT
  306. a.activity_voice_id AS id,
  307. a.activity_id AS source_id,
  308. a.voice_name AS title,
  309. a.voice_url AS resource_url,
  310. 1 AS type,
  311. b.activity_time AS publish_time,
  312. b.chart_permission_id,
  313. b.chart_permission_name,
  314. a.voice_play_seconds AS play_seconds,
  315. a.background_img,
  316. "" AS industry_name,
  317. 0 AS industry_id,
  318. a.share_img,
  319. a.activity_id
  320. FROM
  321. cygx_activity_voice AS a
  322. JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 `
  323. if audioAct != `` {
  324. sql += audioAct
  325. }
  326. //活动视频2
  327. sql += ` UNION ALL `
  328. sql += `
  329. SELECT
  330. a.video_id AS id,
  331. a.activity_id AS source_id,
  332. a.video_name AS title,
  333. a.video_url AS resource_url,
  334. 2 AS type,
  335. b.activity_time as publish_time,
  336. b.chart_permission_id,
  337. b.chart_permission_name,
  338. "" AS play_seconds,
  339. a.background_img,
  340. "" AS industry_name,
  341. 0 AS industry_id,
  342. a.share_img,
  343. a.activity_id
  344. FROM
  345. cygx_activity_video as a
  346. INNER JOIN cygx_activity as b on a.activity_id = b.activity_id WHERE 1= 1 `
  347. if videoAct != `` {
  348. sql += videoAct
  349. }
  350. sql += ` UNION ALL `
  351. // 产业视频3
  352. sql += `SELECT
  353. video_id AS id,
  354. video_id AS source_id,
  355. video_name AS title,
  356. video_url AS resource_url,
  357. 3 AS type,
  358. publish_date AS publish_time,
  359. chart_permission_id,
  360. chart_permission_name,
  361. video_duration AS play_seconds,
  362. img_url AS background_img,
  363. industry_name,
  364. industry_id,
  365. share_img_url AS share_img,
  366. "" as activity_id
  367. FROM
  368. cygx_micro_roadshow_video as a
  369. WHERE
  370. publish_status = 1 `
  371. if videoMico != `` {
  372. sql += videoMico
  373. }
  374. //系列问答
  375. sql += ` UNION ALL `
  376. sql += `
  377. SELECT
  378. a.askserie_video_id AS id,
  379. a.askserie_video_id AS source_id,
  380. a.video_name AS title,
  381. a.video_url AS resource_url,
  382. 4 AS type,
  383. a.publish_date AS publish_time,
  384. a.chart_permission_id,
  385. a.chart_permission_name,
  386. a.video_duration AS play_seconds,
  387. a.background_img,
  388. "" AS industry_name,
  389. 0 AS industry_id,
  390. a.share_img,
  391. 0 as activity_id
  392. FROM
  393. cygx_askserie_video AS a WHERE 1= 1 `
  394. if conditionAskserie != `` {
  395. sql += conditionAskserie
  396. }
  397. sql += ` ORDER BY publish_time DESC`
  398. totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
  399. err = o.Raw(totalSql, audioActPars, videoActPars, videoMicoPars, askseriePars).QueryRow(&total)
  400. if err != nil {
  401. return
  402. }
  403. sql += ` LIMIT ?,?`
  404. _, err = o.Raw(sql, audioActPars, videoActPars, videoMicoPars, askseriePars, startSize, pageSize).QueryRows(&list)
  405. return
  406. }
  407. type MicroList []*MicroRoadShowPageList
  408. func (m MicroList) Len() int {
  409. return len(m)
  410. }
  411. func (m MicroList) Less(i, j int) bool {
  412. return m[i].CollectTime.After(m[j].CollectTime)
  413. }
  414. func (m MicroList) Swap(i, j int) {
  415. m[i], m[j] = m[j], m[i]
  416. }
  417. // CountMicroRoadShowVideoPageList 获取微路演视频数量
  418. func CountMicroRoadShowVideoPageList(condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}) (total int, err error) {
  419. o := orm.NewOrm()
  420. var sql string
  421. sql += `SELECT
  422. video_id AS id,
  423. video_name AS title,
  424. video_url AS resource_url,
  425. 3 AS type,
  426. publish_date AS publish_time,
  427. chart_permission_id,
  428. chart_permission_name,
  429. video_duration AS play_seconds,
  430. img_url AS background_img,
  431. industry_name,
  432. share_img_url AS share_img,
  433. "" as activity_id
  434. FROM
  435. cygx_micro_roadshow_video
  436. WHERE
  437. publish_status = 1 `
  438. if condition != `` {
  439. sql += condition
  440. }
  441. sql += ` UNION ALL `
  442. sql += `
  443. SELECT
  444. video_id AS id,
  445. video_name AS title,
  446. video_url AS resource_url,
  447. 2 AS type,
  448. art.activity_time as publish_time,
  449. art.chart_permission_id,
  450. art.chart_permission_name,
  451. "" AS play_seconds,
  452. v.background_img,
  453. "" AS industry_name,
  454. v.share_img,
  455. v.activity_id
  456. FROM
  457. cygx_activity_video as v
  458. INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1 `
  459. if conditionAct != `` {
  460. sql += conditionAct
  461. }
  462. sql += ` UNION ALL `
  463. sql += `
  464. SELECT
  465. a.activity_voice_id AS id,
  466. a.voice_name AS title,
  467. a.voice_url AS resource_url,
  468. 1 AS type,
  469. b.activity_time AS publish_time,
  470. b.chart_permission_id,
  471. b.chart_permission_name,
  472. a.voice_play_seconds AS play_seconds,
  473. a.background_img,
  474. "" AS industry_name,
  475. a.share_img,
  476. a.activity_id
  477. FROM
  478. cygx_activity_voice AS a
  479. JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 `
  480. if conditionAudio != `` {
  481. sql += conditionAudio
  482. }
  483. sql += ` ORDER BY publish_time DESC`
  484. totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
  485. err = o.Raw(totalSql, pars, parsAct, parsAudio).QueryRow(&total)
  486. return
  487. }
  488. // GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
  489. func GetMicroRoadShowVideoPageListIkWord(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}, audioId, videoId, activityVideoId, filter int) (list []*MicroRoadShowPageList, err error) {
  490. o := orm.NewOrm()
  491. var sql string
  492. //if audioId+activityVideoId == 0 && filter != 2 {
  493. sql += `SELECT
  494. video_id AS id,
  495. video_name AS title,
  496. video_url AS resource_url,
  497. 3 AS type,
  498. publish_date AS publish_time,
  499. chart_permission_id,
  500. chart_permission_name,
  501. video_duration AS play_seconds,
  502. img_url AS background_img,
  503. industry_name,
  504. industry_id AS industrial_management_id,
  505. share_img_url AS share_img,
  506. "" as activity_id
  507. FROM
  508. cygx_micro_roadshow_video
  509. WHERE
  510. publish_status = 1 `
  511. if condition != `` {
  512. sql += condition
  513. }
  514. //}
  515. //if audioId+videoId+activityVideoId == 0 && filter != 2 {
  516. // sql += ` UNION ALL `
  517. //}
  518. sql += ` UNION ALL `
  519. //if audioId+videoId == 0 && filter != 2 {
  520. sql += `
  521. SELECT
  522. video_id AS id,
  523. video_name AS title,
  524. video_url AS resource_url,
  525. 2 AS type,
  526. art.activity_time as publish_time,
  527. art.chart_permission_id,
  528. art.chart_permission_name,
  529. "" AS play_seconds,
  530. v.background_img,
  531. "" AS industry_name,
  532. 0 AS industrial_management_id,
  533. v.share_img,
  534. v.activity_id
  535. FROM
  536. cygx_activity_video as v
  537. INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1 `
  538. if conditionAct != `` {
  539. sql += conditionAct
  540. }
  541. //}
  542. //if audioId+videoId+activityVideoId == 0 && filter == 0 {
  543. // sql += ` UNION ALL `
  544. //}
  545. sql += ` UNION ALL `
  546. //if videoId+activityVideoId == 0 && filter != 1 {
  547. sql += `
  548. SELECT
  549. a.activity_voice_id AS id,
  550. a.voice_name AS title,
  551. a.voice_url AS resource_url,
  552. 1 AS type,
  553. b.activity_time AS publish_time,
  554. b.chart_permission_id,
  555. b.chart_permission_name,
  556. a.voice_play_seconds AS play_seconds,
  557. a.background_img,
  558. "" AS industry_name,
  559. 0 AS industrial_management_id,
  560. a.share_img,
  561. a.activity_id
  562. FROM
  563. cygx_activity_voice AS a
  564. JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 `
  565. if conditionAudio != `` {
  566. sql += conditionAudio
  567. }
  568. //}
  569. sql += ` ORDER BY publish_time DESC`
  570. sql += ` LIMIT ?,?`
  571. _, err = o.Raw(sql, pars, parsAct, parsAudio, startSize, pageSize).QueryRows(&list)
  572. return
  573. }
  574. type AddVideoCommnetReq struct {
  575. //Id int `description:"活动或产业ID"`
  576. SourceId int `description:"资源ID"`
  577. SourceType int `description:"视频来源: 1-音频; 2-活动视频; 3-微路演视频 (不传默认为1)"`
  578. Content string `description:"内容"`
  579. Title string `description:"标题"`
  580. }
  581. type MicroRoadshowCollectReq struct {
  582. //Id int `description:"音频或视频ID"`
  583. SourceId int `description:"资源ID"`
  584. SourceType int `description:"视频来源: 1-音频; 2-活动视频; 3-微路演视频 (不传默认为1)"`
  585. }