micro_roadshow.go 21 KB

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