|
@@ -58,6 +58,7 @@ func (this *HomeController) NewList() {
|
|
|
var pars []interface{}
|
|
|
var yanxuanActivityIds []int
|
|
|
var yanxuanArticleIds []int
|
|
|
+ var conditionresp string
|
|
|
//var yanxuanspecialIds []int
|
|
|
|
|
|
if hashtagKeyword != "" {
|
|
@@ -70,20 +71,20 @@ func (this *HomeController) NewList() {
|
|
|
resp := new(models.HomeResourceDataListResp)
|
|
|
|
|
|
if keyWord == "" {
|
|
|
- //condition += " AND source IN ('article','activity','yanxuanspecial') " // 只有研选的文章、研选的活动、研选的专栏这三种
|
|
|
condition += " AND source IN ('article','activity','yanxuanspecial','activityvoice','activityvideo') AND IF ( source IN('activityvoice','activityvideo') , chart_permission_id = 31 ,1=1 ) " // 只有研选的文章、研选的活动、研选的专栏这三种
|
|
|
if labelKeyword == "" {
|
|
|
//查询近一个月的数据
|
|
|
- condition += " AND search_order_time > '" + time.Now().AddDate(0, 0, -60).Format(utils.FormatDateTime) + "'"
|
|
|
+ condition += " AND search_order_time > '" + time.Now().AddDate(0, 0, -180).Format(utils.FormatDateTime) + "'"
|
|
|
yanxuanActivityIds = services.GetYanxuanActivityIds(user, "1,2") // 获取所有的研选活动ID
|
|
|
yanxuanArticleIds = services.GetYanxuanArticleIds() //获取所有研选文章ID
|
|
|
} else {
|
|
|
- yanxuanActivityIds, yanxuanArticleIds, err = services.GetConditionInitByTagIds(user, labelKeyword)
|
|
|
+ yanxuanActivityIds, yanxuanArticleIds, conditionresp, err = services.GetConditionInitByTagIds(user, labelKeyword)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取活动权限数据失败,GetConditionInitByTagIds Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ condition += conditionresp
|
|
|
//如果不是 "全部报告" 、 "专栏" 的关键词查询,就不做研选专栏的查询
|
|
|
if labelKeyword != utils.LABEL_L2_1 && labelKeyword != utils.LABEL_L2_2 {
|
|
|
condition += ` AND IF ( source = 'yanxuanspecial' , source_id IN (0) ,1=1 ) `
|
|
@@ -105,6 +106,7 @@ func (this *HomeController) NewList() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
list, err = services.GetResourceDataList(condition, pars, startSize, pageSize, user)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -119,6 +121,7 @@ func (this *HomeController) NewList() {
|
|
|
br.ErrMsg = "检索失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
total = tmpTotalResult
|
|
|
list, err = services.GetResourceDataEsList(tmpResult, user)
|
|
|
if err != nil {
|