|
@@ -592,6 +592,7 @@ func (this *UserController) RemarkList() {
|
|
|
// @Title 互动详情table栏
|
|
|
// @Description 互动详情table栏接口
|
|
|
// @Param UserId query int true "用户id"
|
|
|
+// @Param ClassType query int true "列表类型,1:权益,2:研选,默认1"
|
|
|
// @Success 200 {object} cygx.UserRemarksListResp
|
|
|
// @router /user/table/list [get]
|
|
|
func (this *UserController) TableList() {
|
|
@@ -612,6 +613,7 @@ func (this *UserController) TableList() {
|
|
|
br.Msg = "用户不存在"
|
|
|
return
|
|
|
}
|
|
|
+ classType, _ := this.GetInt("ClassType", 1)
|
|
|
wxUser, err := models.GetWxUserByUserId(userId)
|
|
|
if err != nil {
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
@@ -624,27 +626,47 @@ func (this *UserController) TableList() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- //阅读记录总数
|
|
|
- countDetail, err := cygx.GetUserInteractionTableCount(userId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取各个阅读总数失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+ resp := new(cygx.CygxUserTableListRep)
|
|
|
+ if classType == 1 {
|
|
|
+ countDetail, err := cygx.GetUserInteractionTableCount(userId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取各个阅读总数失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ List := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: countDetail.HistoryNum},
|
|
|
+ {PermissionName: "活动互动记录", Source: 2, TotalNum: countDetail.OnLineNum + countDetail.OfficeNum},
|
|
|
+ {PermissionName: "专项调研", Source: 8, TotalNum: countDetail.TripNum},
|
|
|
+ {PermissionName: "收藏的报告", Source: 3, TotalNum: countDetail.CountNum},
|
|
|
+ {PermissionName: "收藏的图表", Source: 4, TotalNum: countDetail.ChartNum},
|
|
|
+ {PermissionName: "关注的产业", Source: 5, TotalNum: countDetail.IndustryFllowNum},
|
|
|
+ {PermissionName: "搜索", Source: 7, TotalNum: countDetail.KeyWordNum},
|
|
|
+ {PermissionName: "音视频播放", Source: 9, TotalNum: countDetail.RoadshowVideoNum + countDetail.ActivityVideoNum + countDetail.ActivityVoiceNum},
|
|
|
+ {PermissionName: "首页标签点击", Source: 10, TotalNum: countDetail.TagNum}}
|
|
|
+ resp.List = List
|
|
|
+ } else {
|
|
|
+ countDetail, err := cygx.GetUserInteractionTableCountByYanXuan(userId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取各个阅读总数失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ List := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: countDetail.HistoryNum},
|
|
|
+ {PermissionName: "活动互动记录", Source: 2, TotalNum: countDetail.OnLineNum + countDetail.OfficeNum},
|
|
|
+ {PermissionName: "收藏的报告", Source: 3, TotalNum: countDetail.CountNum},
|
|
|
+ {PermissionName: "关注的产业", Source: 5, TotalNum: countDetail.IndustryFllowNum},
|
|
|
+ {PermissionName: "关注的作者", Source: 6, TotalNum: countDetail.DepartmentFollowNum},
|
|
|
+ {PermissionName: "专栏文章阅读记录", Source: 11, TotalNum: countDetail.YanxuanSpecialNum},
|
|
|
+ {PermissionName: "收藏的专栏文章", Source: 12, TotalNum: countDetail.YanxuanSpecialCollectNum},
|
|
|
+ {PermissionName: "关注的专栏作者", Source: 13, TotalNum: countDetail.YanxuanSpecialFollowNum},
|
|
|
+ {PermissionName: "搜索", Source: 7, TotalNum: 0}}
|
|
|
+ resp.List = List
|
|
|
}
|
|
|
|
|
|
- List := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: countDetail.HistoryNum + countDetail.YanxuanSpecialNum},
|
|
|
- {PermissionName: "活动互动记录", Source: 2, TotalNum: countDetail.OnLineNum + countDetail.OfficeNum},
|
|
|
- {PermissionName: "专项调研", Source: 8, TotalNum: countDetail.TripNum},
|
|
|
- {PermissionName: "收藏的报告", Source: 3, TotalNum: countDetail.CountNum},
|
|
|
- {PermissionName: "收藏的图表", Source: 4, TotalNum: countDetail.ChartNum},
|
|
|
- {PermissionName: "关注的产业", Source: 5, TotalNum: countDetail.IndustryFllowNum},
|
|
|
- {PermissionName: "关注的作者", Source: 6, TotalNum: countDetail.DepartmentFollowNum},
|
|
|
- {PermissionName: "搜索", Source: 7, TotalNum: countDetail.KeyWordNum},
|
|
|
- {PermissionName: "音视频播放", Source: 9, TotalNum: countDetail.RoadshowVideoNum + countDetail.ActivityVideoNum + countDetail.ActivityVoiceNum},
|
|
|
- {PermissionName: "首页标签点击", Source: 10, TotalNum: countDetail.TagNum}}
|
|
|
+ //阅读记录总数
|
|
|
|
|
|
- resp := new(cygx.CygxUserTableListRep)
|
|
|
- resp.List = List
|
|
|
resp.UserName = wxUser.RealName
|
|
|
resp.Mobile = wxUser.Mobile
|
|
|
resp.ComapnyName = comanyDetail.CompanyName
|
|
@@ -666,6 +688,7 @@ func (this *UserController) TableList() {
|
|
|
// @Param StartDate query string true "开始时间"
|
|
|
// @Param EndDate query string true "结束时间"
|
|
|
// @Param KeyWord query string true "搜索关键词"
|
|
|
+// @Param ClassType query int true "列表类型,1:权益,2:研选,默认1"
|
|
|
// @Success 200 {object} cygx.UserInteractionListResp
|
|
|
// @router /user/interaction/detail [get]
|
|
|
func (this *UserController) TableDetail() {
|
|
@@ -699,6 +722,7 @@ func (this *UserController) TableDetail() {
|
|
|
keyWord := this.GetString("KeyWord")
|
|
|
source, _ := this.GetInt("Source")
|
|
|
identityType, _ := this.GetInt("IdentityType")
|
|
|
+ classType, _ := this.GetInt("ClassType", 1)
|
|
|
if userId < 1 {
|
|
|
br.Msg = "用户不存在"
|
|
|
return
|
|
@@ -714,30 +738,30 @@ func (this *UserController) TableDetail() {
|
|
|
}
|
|
|
mobile := wxUser.Mobile
|
|
|
|
|
|
- var checkSource bool
|
|
|
+ //var checkSource bool
|
|
|
var MeetingNum int
|
|
|
var NoMeetingNum int
|
|
|
var list []*cygx.UserInteraction
|
|
|
|
|
|
- listTable := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: 10},
|
|
|
- {PermissionName: "活动互动记录", Source: 2, TotalNum: 10},
|
|
|
- {PermissionName: "收藏的报告", Source: 3, TotalNum: 10},
|
|
|
- {PermissionName: "收藏图表", Source: 4, TotalNum: 10},
|
|
|
- {PermissionName: "关注的产业", Source: 5, TotalNum: 10},
|
|
|
- {PermissionName: "关注的作者", Source: 6, TotalNum: 10},
|
|
|
- {PermissionName: "搜索", Source: 7, TotalNum: 10},
|
|
|
- {PermissionName: "专项调研", Source: 8, TotalNum: 10},
|
|
|
- {PermissionName: "音视频播放", Source: 9, TotalNum: 10},
|
|
|
- {PermissionName: "首页标签点击", Source: 10, TotalNum: 10}}
|
|
|
- for _, v := range listTable {
|
|
|
- if v.Source == source {
|
|
|
- checkSource = true
|
|
|
- }
|
|
|
- }
|
|
|
- //默认类型1
|
|
|
- if !checkSource {
|
|
|
- source = 1
|
|
|
- }
|
|
|
+ //listTable := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: 10},
|
|
|
+ // {PermissionName: "活动互动记录", Source: 2, TotalNum: 10},
|
|
|
+ // {PermissionName: "收藏的报告", Source: 3, TotalNum: 10},
|
|
|
+ // {PermissionName: "收藏图表", Source: 4, TotalNum: 10},
|
|
|
+ // {PermissionName: "关注的产业", Source: 5, TotalNum: 10},
|
|
|
+ // {PermissionName: "关注的作者", Source: 6, TotalNum: 10},
|
|
|
+ // {PermissionName: "搜索", Source: 7, TotalNum: 10},
|
|
|
+ // {PermissionName: "专项调研", Source: 8, TotalNum: 10},
|
|
|
+ // {PermissionName: "音视频播放", Source: 9, TotalNum: 10},
|
|
|
+ // {PermissionName: "首页标签点击", Source: 10, TotalNum: 10}}
|
|
|
+ //for _, v := range listTable {
|
|
|
+ // if v.Source == source {
|
|
|
+ // checkSource = true
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ ////默认类型1
|
|
|
+ //if !checkSource {
|
|
|
+ // source = 1
|
|
|
+ //}
|
|
|
var total int
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
@@ -760,6 +784,11 @@ func (this *UserController) TableDetail() {
|
|
|
// return
|
|
|
//}
|
|
|
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND art.article_type_id = 0 "
|
|
|
+ } else {
|
|
|
+ condition += " AND art.article_type_id > 0 "
|
|
|
+ }
|
|
|
condition += " AND (r.mobile = '" + wxUser.Mobile + "' OR r.email = '" + wxUser.Mobile + "') "
|
|
|
|
|
|
total, list, err = cygx.GetCygxArticleHistoryRecordByUserNew(condition, startSize, pageSize)
|
|
@@ -821,6 +850,11 @@ func (this *UserController) TableDetail() {
|
|
|
} else if source == 2 {
|
|
|
if mobile != "" {
|
|
|
condition = ` AND s.mobile = '` + mobile + `' `
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND a.chart_permission_id != 31 "
|
|
|
+ } else {
|
|
|
+ condition += " AND a.chart_permission_id = 31 "
|
|
|
+ }
|
|
|
|
|
|
if isMeeting == "1" {
|
|
|
condition += ` AND s.is_meeting = 1 `
|
|
@@ -885,7 +919,13 @@ func (this *UserController) TableDetail() {
|
|
|
}
|
|
|
}
|
|
|
} else if source == 3 {
|
|
|
- total, err = cygx.GetCygxArticleCollectCount(userId)
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND art.article_type_id = 0 "
|
|
|
+ } else {
|
|
|
+ condition += " AND art.article_type_id > 0 "
|
|
|
+ }
|
|
|
+
|
|
|
+ total, err = cygx.GetCygxArticleCollectCount(userId, condition)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取用户收藏记录总数失败,Err:" + err.Error()
|
|
@@ -939,13 +979,20 @@ func (this *UserController) TableDetail() {
|
|
|
}
|
|
|
}
|
|
|
} else if source == 5 {
|
|
|
- total, err = cygx.GetCygxIndustryFllowCount(userId)
|
|
|
+
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND a.chart_permission_id = 31 "
|
|
|
+ } else {
|
|
|
+ condition += " AND a.chart_permission_id = 31 "
|
|
|
+ }
|
|
|
+
|
|
|
+ total, err = cygx.GetCygxIndustryFllowCount(userId, condition)
|
|
|
if err != nil {
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
br.Msg = "获取用户关注总数失败"
|
|
|
return
|
|
|
}
|
|
|
- list, err = cygx.GetCygxIndustryFllowByUser(userId, startSize, pageSize)
|
|
|
+ list, err = cygx.GetCygxIndustryFllowByUser(userId, startSize, pageSize, condition)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
br.Msg = "获取用户关注总数失败"
|
|
@@ -1060,6 +1107,73 @@ func (this *UserController) TableDetail() {
|
|
|
br.Msg = "获取搜索记录列表失败"
|
|
|
return
|
|
|
}
|
|
|
+ } else if source == 11 { //专栏文章阅读记录
|
|
|
+ if startDate != "" {
|
|
|
+ startDate += " 00:00:00"
|
|
|
+ condition += ` AND r.create_time >= '` + startDate + `' `
|
|
|
+ }
|
|
|
+ if endDate != "" {
|
|
|
+ endDate += " 23:59:59"
|
|
|
+ condition += ` AND r.create_time <= '` + endDate + `' `
|
|
|
+ }
|
|
|
+ if wxUser.Mobile == "" {
|
|
|
+ wxUser.Mobile = wxUser.Email
|
|
|
+ }
|
|
|
+ condition += " AND (r.mobile = '" + wxUser.Mobile + "' OR r.email = '" + wxUser.Mobile + "') "
|
|
|
+ total, list, err = cygx.GetCygxYanxuaSspecialHistoryRecordByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(list) > 0 {
|
|
|
+ for k, v := range list {
|
|
|
+ list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if source == 12 { //收藏的专栏文章
|
|
|
+ if startDate != "" {
|
|
|
+ startDate += " 00:00:00"
|
|
|
+ condition += ` AND r.create_time >= '` + startDate + `' `
|
|
|
+ }
|
|
|
+ if endDate != "" {
|
|
|
+ endDate += " 23:59:59"
|
|
|
+ condition += ` AND r.create_time <= '` + endDate + `' `
|
|
|
+ }
|
|
|
+ if wxUser.Mobile == "" {
|
|
|
+ wxUser.Mobile = wxUser.Email
|
|
|
+ }
|
|
|
+ condition += " AND (r.mobile = '" + wxUser.Mobile + "' OR r.email = '" + wxUser.Mobile + "') "
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialCollectByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(list) > 0 {
|
|
|
+ for k, v := range list {
|
|
|
+ list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if source == 13 { //关注的专栏作者
|
|
|
+ if startDate != "" {
|
|
|
+ startDate += " 00:00:00"
|
|
|
+ condition += ` AND r.create_time >= '` + startDate + `' `
|
|
|
+ }
|
|
|
+ if endDate != "" {
|
|
|
+ endDate += " 23:59:59"
|
|
|
+ condition += ` AND r.create_time <= '` + endDate + `' `
|
|
|
+ }
|
|
|
+ if wxUser.Mobile == "" {
|
|
|
+ wxUser.Mobile = wxUser.Email
|
|
|
+ }
|
|
|
+ condition += " AND (r.mobile = '" + wxUser.Mobile + "' OR r.email = '" + wxUser.Mobile + "') "
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialAuthorByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp := new(cygx.UserInteractionListResp)
|