|
@@ -1583,15 +1583,101 @@ func (this *ActivityController) ActivityListSearch() {
|
|
|
condition += ` AND art.yidong_activity_id = '' `
|
|
|
}
|
|
|
condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
|
|
|
- list, total, err := services.GetActivitySpecialSearcheList(user, condition, startSize, pageSize, keyWord, playBack)
|
|
|
+ listActivity, total, err := services.GetActivitySpecialSearcheList(user, condition, startSize, pageSize, keyWord, playBack)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //用户权限
|
|
|
+ authInfo, permissionArr, e := services.GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取用户权限失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- resp := new(models.GetCygxActivityListSearchResp)
|
|
|
+ resp := new(models.HomeResourceDataListResp)
|
|
|
+ var list []*models.CygxResourceDataResp
|
|
|
+ for _, v := range listActivity {
|
|
|
+ var item = new(models.CygxResourceDataResp)
|
|
|
+ //resp.List = append(resp.List, &models.CygxResourceDataResp{
|
|
|
+ item.SourceId = v.ActivityId
|
|
|
+ if v.SourceType == 1 {
|
|
|
+ item.Source = "activity"
|
|
|
+ } else {
|
|
|
+ item.Source = "activityspecial"
|
|
|
+ }
|
|
|
+ item.Title = v.ActivityName
|
|
|
+ item.City = v.City
|
|
|
+ item.IsSignup = v.IsSignup
|
|
|
+ item.IsCancelMeetingReminder = v.IsCancelMeetingReminder
|
|
|
+ item.IsAppointment = v.IsAppointment
|
|
|
+ item.ActiveState = v.ActiveState
|
|
|
+ item.ImgUrlText = v.ImgUrlText
|
|
|
+ item.ImgUrl = v.ImgUrl
|
|
|
+ item.ActivityType = v.ActivityType
|
|
|
+ item.IsShowOutboundCall = v.IsShowOutboundCall
|
|
|
+ item.IsShowMeetingReminder = v.IsShowMeetingReminder
|
|
|
+ item.IsShowHelpSsk = v.IsShowHelpSsk
|
|
|
+ item.IsShowSignup = v.IsShowSignup
|
|
|
+ item.IsShowAppointment = v.IsShowAppointment
|
|
|
+ item.IsShowDetails = v.IsShowDetails
|
|
|
+ item.ActivityTimeText = v.ActivityTimeText
|
|
|
+ item.Expert = v.Expert
|
|
|
+ item.Speaker = v.Speaker
|
|
|
+ item.PublishDate = v.ActivityTime
|
|
|
+ item.TripImgLink = v.TripImgLink
|
|
|
+ item.TripStatus = 2
|
|
|
+ item.ActiveState = v.ActiveState
|
|
|
+ item.PublishDate = v.ActivityTime
|
|
|
+
|
|
|
+ if v.VoiceList != nil || v.VideoDetail != nil {
|
|
|
+ if v.FileType == 1 {
|
|
|
+ if v.VoiceList != nil {
|
|
|
+ item.ResourceUrl = v.VoiceList.Url
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if v.VideoDetail != nil {
|
|
|
+ item.ResourceUrl = v.VideoDetail.ResourceUrl
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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 v.ChartPermissionId != utils.HONG_GUAN_ID && !utils.InArrayByStr(permissionArr, v.ChartPermissionName) {
|
|
|
+ au.HasPermission = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 无权限的弹框提示
|
|
|
+ if au.HasPermission != 1 {
|
|
|
+ if au.OperationMode == services.UserPermissionOperationModeCall {
|
|
|
+ if v.FileType == 1 {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgCallActivity
|
|
|
+ } else {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgCallMicroVideo
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if v.FileType == 1 {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgApplyActivity
|
|
|
+ } else {
|
|
|
+ au.PopupMsg = services.UserPermissionPopupMsgApplyMicroVideo
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.AuthInfo = au
|
|
|
+ }
|
|
|
+ list = append(list, item)
|
|
|
+ }
|
|
|
+ if len(resp.List) == 0 {
|
|
|
+ resp.List = make([]*models.CygxResourceDataResp, 0)
|
|
|
+ }
|
|
|
//添加活动搜索记录
|
|
|
if keyWord != "" {
|
|
|
//go services.AddActivitykeyWordSearch(keyWord, user)
|