|
@@ -2065,12 +2065,12 @@ func (this *UserController) CompanyTableList() {
|
|
|
conditionIndustryFllow := condition //产业关注搜索条件
|
|
|
conditionKeyWord := condition //关键词记录搜索条件
|
|
|
if classType == 1 {
|
|
|
- conditionArtcile += " AND art.article_type_id > 0 "
|
|
|
+ conditionArtcile += " AND art.article_type_id = 0 "
|
|
|
conditionActivityMeet += " AND a.chart_permission_id != 31 "
|
|
|
conditionIndustryFllow += " AND m.chart_permission_id != 31 "
|
|
|
conditionKeyWord += " AND r.register_platform IN (1,2) "
|
|
|
} else {
|
|
|
- conditionArtcile += " AND art.article_type_id = 0 "
|
|
|
+ conditionArtcile += " AND art.article_type_id > 0 "
|
|
|
conditionActivityMeet += " AND a.chart_permission_id = 31 "
|
|
|
conditionIndustryFllow += " AND m.chart_permission_id = 31 "
|
|
|
conditionKeyWord += " AND r.register_platform IN (5,6) "
|
|
@@ -2219,7 +2219,7 @@ func (this *UserController) CompanyTableList() {
|
|
|
return
|
|
|
}
|
|
|
//获取关注作者总数
|
|
|
- departmentFollowNum, err = cygx.GetCygArticleDepartmentFollowCountByCompanyWeekly(conditionIndustryFllow)
|
|
|
+ departmentFollowNum, err = cygx.GetCygArticleDepartmentFollowCountByCompanyWeekly(condition)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取关注作者总数失败,Err:" + err.Error()
|
|
@@ -2324,6 +2324,7 @@ func (this *UserController) CompanyTableList() {
|
|
|
// @Param EndDate query string false "结束时间"
|
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
|
// @Param ActivityName query string false "活动名称"
|
|
|
+// @Param ClassType query int true "列表类型,1:权益,2:研选,默认1"
|
|
|
// @Success 200 {object} cygx.UserInteractionListResp
|
|
|
// @router /user/company/interaction/detail [get]
|
|
|
func (this *UserController) CompanyTableDetail() {
|
|
@@ -2357,6 +2358,7 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
keyWord := this.GetString("KeyWord")
|
|
|
activityName := this.GetString("ActivityName")
|
|
|
source, _ := this.GetInt("Source")
|
|
|
+ classType, _ := this.GetInt("ClassType", 1)
|
|
|
if companyId < 1 {
|
|
|
br.Msg = "用户不存在"
|
|
|
return
|
|
@@ -2376,6 +2378,22 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
condition += ` AND ( r.mobile LIKE '%` + keyWord + `%' OR r.email LIKE '%` + keyWord + `%' OR r.real_name LIKE '%` + keyWord + `%')`
|
|
|
}
|
|
|
|
|
|
+ conditionArtcile := condition //文章搜索条件
|
|
|
+ conditionActivityMeet := condition //活动到会搜索条件
|
|
|
+ conditionIndustryFllow := condition //产业关注搜索条件
|
|
|
+ conditionKeyWord := condition //关键词记录搜索条件
|
|
|
+ if classType == 1 {
|
|
|
+ conditionArtcile += " AND art.article_type_id = 0 "
|
|
|
+ conditionActivityMeet += " AND a.chart_permission_id != 31 "
|
|
|
+ conditionIndustryFllow += " AND m.chart_permission_id != 31 "
|
|
|
+ conditionKeyWord += " AND r.register_platform IN (1,2) "
|
|
|
+ } else {
|
|
|
+ conditionArtcile += " AND art.article_type_id > 0 "
|
|
|
+ conditionActivityMeet += " AND a.chart_permission_id = 31 "
|
|
|
+ conditionIndustryFllow += " AND m.chart_permission_id = 31 "
|
|
|
+ conditionKeyWord += " AND r.register_platform IN (5,6) "
|
|
|
+ }
|
|
|
+
|
|
|
var isAdminRole bool
|
|
|
//如果不是管理员身份或者研究员身份则需要添加可见范围处理
|
|
|
if sysUser.Role == utils.ROLE_TYPE_CODE_ADMIN || sysUser.Role == utils.ROLE_TYPE_CODE_RESEARCHR {
|
|
@@ -2391,6 +2409,11 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
endDate += " 23:59:59"
|
|
|
condition += ` AND r.create_time <= '` + endDate + `' `
|
|
|
}
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND art.article_type_id = 0 "
|
|
|
+ } else {
|
|
|
+ condition += " AND art.article_type_id > 0 "
|
|
|
+ }
|
|
|
condition += " ORDER BY r.create_time DESC "
|
|
|
var listRecord []*cygx.CygxArticleAndYanxuanRecordResp
|
|
|
if isAdminRole {
|
|
@@ -2455,6 +2478,13 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
if activityName != "" {
|
|
|
condition += ` AND a.activity_name LIKE '%` + activityName + `%' `
|
|
|
}
|
|
|
+
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND a.chart_permission_id != 31 "
|
|
|
+ } else {
|
|
|
+ condition += " AND a.chart_permission_id = 31 "
|
|
|
+ }
|
|
|
+
|
|
|
if isAdminRole {
|
|
|
total, err = cygx.GetActivityMeetByCompanyCount(condition)
|
|
|
if err != nil {
|
|
@@ -2505,6 +2535,11 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
}
|
|
|
}
|
|
|
} else if source == 3 {
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND art.article_type_id = 0 "
|
|
|
+ } else {
|
|
|
+ condition += " AND art.article_type_id > 0 "
|
|
|
+ }
|
|
|
if isAdminRole {
|
|
|
total, err = cygx.GetCygxArticleCollectCountByCompany(condition)
|
|
|
if err != nil {
|
|
@@ -2598,6 +2633,11 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
}
|
|
|
|
|
|
} else if source == 5 {
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND m.chart_permission_id != 31 "
|
|
|
+ } else {
|
|
|
+ condition += " AND m.chart_permission_id = 31 "
|
|
|
+ }
|
|
|
if isAdminRole {
|
|
|
total, err = cygx.GetCygxIndustryFllowCountByCompany(condition)
|
|
|
if err != nil {
|
|
@@ -2669,6 +2709,11 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
}
|
|
|
}
|
|
|
} else if source == 7 {
|
|
|
+ if classType == 1 {
|
|
|
+ condition += " AND r.register_platform IN (1,2) "
|
|
|
+ } else {
|
|
|
+ condition += " AND r.register_platform IN (5,6) "
|
|
|
+ }
|
|
|
if isAdminRole {
|
|
|
total, err = cygx.GetCygxSearchKeyWordCountBuCompany(condition)
|
|
|
if err != nil {
|
|
@@ -2753,11 +2798,6 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
}
|
|
|
}
|
|
|
} else if source == 10 { //标签点击记录
|
|
|
- //condition = ``
|
|
|
- //condition += ` AND r.create_time < '` + time.Now().Format(utils.FormatDate) + `' `
|
|
|
- //if keyWord != "" {
|
|
|
- // condition += ` AND (r.mobile LIKE '%` + keyWord + `%' OR r.email LIKE '%` + keyWord + `%' OR r.real_name LIKE '%` + keyWord + `%'` + ` OR r.company_name LIKE '%` + keyWord + `%') `
|
|
|
- //}
|
|
|
if isAdminRole {
|
|
|
total, err = cygx.GetCygxTagHistoryCount(condition)
|
|
|
if err != nil {
|
|
@@ -2785,6 +2825,69 @@ func (this *UserController) CompanyTableDetail() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ } else if source == 11 { //专栏文章阅读记录
|
|
|
+ if isAdminRole {
|
|
|
+ total, list, err = cygx.GetCygxYanxuaSspecialHistoryRecordByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ total, list, err = cygx.GetCygxYanxuaSspecialHistoryRecordByUserWeekly(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 isAdminRole {
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialCollectByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialCollectByUserWeekly(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 isAdminRole {
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialAuthorByUser(condition, startSize, pageSize)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户阅读记录,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ total, list, err = cygx.GetCygxYanxuanSpecialAuthorByUserWeekly(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)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|