|
@@ -722,3 +722,136 @@ func (this *MicroRoadShowController) AskserieVideoDetail() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (this *MicroRoadShowController) TrainingList() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ pageSize, _ := this.GetInt("PageSize")
|
|
|
+ currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+
|
|
|
+ if pageSize <= 0 {
|
|
|
+ pageSize = utils.PageSize20
|
|
|
+ }
|
|
|
+ if currentIndex <= 0 {
|
|
|
+ currentIndex = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ var audioIds []string
|
|
|
+ var videoIds []string
|
|
|
+ var activityVideoIds []string
|
|
|
+ var askserieVideoIds []string
|
|
|
+ activityVideoIds = []string{"461", "462", "463", "464", "465", "466"}
|
|
|
+ activityVideoTitle := []string{"第一期_A股运行特征探讨", "第二期_行业比较研究", "第三期_市场风格观察与我们的研究方法", "第四期_市场估值指标追踪", "第五期_宏观经济研究", "第六期_市场回顾专题"}
|
|
|
+ audioIdstr := strings.Join(audioIds, ",")
|
|
|
+ ideoIdsStr := strings.Join(videoIds, ",")
|
|
|
+ activityVideoIdsStr := strings.Join(activityVideoIds, ",")
|
|
|
+ askserieVideoIdsStr := strings.Join(askserieVideoIds, ",")
|
|
|
+
|
|
|
+ list, total, e := services.GetMicroRoadShowMycollectV12(pageSize, currentIndex, audioIdstr, activityVideoIdsStr, ideoIdsStr, askserieVideoIdsStr, user)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ reversed := []*models.MicroRoadShowPageList{}
|
|
|
+ for i := range list {
|
|
|
+ n := list[len(list)-1-i]
|
|
|
+ reversed = append(reversed, n)
|
|
|
+ }
|
|
|
+ list = reversed
|
|
|
+
|
|
|
+
|
|
|
+ authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取用户权限失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ audioMap, videoMap, audioShareMap, videoShareMap, e := services.GetMicroRoadShowDefaultImgConfig()
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for i := range list {
|
|
|
+
|
|
|
+ au := new(models.UserPermissionAuthInfo)
|
|
|
+ au.SellerName = authInfo.SellerName
|
|
|
+ au.SellerMobile = authInfo.SellerMobile
|
|
|
+ au.HasPermission = authInfo.HasPermission
|
|
|
+ au.OperationMode = authInfo.OperationMode
|
|
|
+ if au.HasPermission == 1 {
|
|
|
+
|
|
|
+ if list[i].ChartPermissionId != utils.HONG_GUAN_ID && !utils.InArrayByStr(permissionArr, list[i].ChartPermissionName) {
|
|
|
+ au.HasPermission = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if au.HasPermission != 1 {
|
|
|
+ if au.OperationMode == services.UserPermissionOperationModeCall {
|
|
|
+ if list[i].Type == 1 {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgCallActivity
|
|
|
+ } else {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgCallMicroVideo
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if list[i].Type == 1 {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgApplyActivity
|
|
|
+ } else {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgApplyMicroVideo
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list[i].AuthInfo = au
|
|
|
+ list[i].PublishTime = utils.StrTimeToTime(list[i].PublishTime).Format(utils.FormatDate)
|
|
|
+
|
|
|
+ if list[i].BackgroundImg == "" {
|
|
|
+ if list[i].Type == 1 {
|
|
|
+ list[i].BackgroundImg = audioMap[list[i].ChartPermissionId]
|
|
|
+ } else {
|
|
|
+ list[i].BackgroundImg = videoMap[list[i].ChartPermissionId]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if list[i].ShareImg == "" {
|
|
|
+ if list[i].Type == 1 {
|
|
|
+ list[i].ShareImg = audioShareMap[list[i].ChartPermissionId]
|
|
|
+ } else {
|
|
|
+ list[i].ShareImg = videoShareMap[list[i].ChartPermissionId]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if i <= len(activityVideoTitle)-1 {
|
|
|
+ list[i].Title = activityVideoTitle[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ resp := new(models.MicroRoadShowListResp)
|
|
|
+ page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
+ resp.List = list
|
|
|
+ resp.Paging = page
|
|
|
+ resp.Describe = "弘则策略首席 马冬凡 主讲"
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|