|
@@ -712,22 +712,29 @@ func (this *HomeController) NewList() {
|
|
|
|
|
|
articleTypesCond := ``
|
|
|
if articleTypes != "" {
|
|
|
- articleTypesCond += ` AND sub_category_name In (`+ activityTypes +`) OR type_name IN (`+ activityTypes +`) OR article_type_name IN (`+ activityTypes +`) `
|
|
|
- }
|
|
|
- activityTypesCond := ``
|
|
|
- if activityTypes != "" {
|
|
|
- activityTypesCond += ` AND sub_category_name In (`+ activityTypes +`) `
|
|
|
+ articleTypesCond += ` AND art.sub_category_name In (`+ activityTypes +`) `
|
|
|
}
|
|
|
+ //activityTypesCond := ``
|
|
|
+ //if activityTypes != "" {
|
|
|
+ // activityTypesCond += ` AND sub_category_name In (`+ activityTypes +`) `
|
|
|
+ //}
|
|
|
industriesCond := ``
|
|
|
if industries != "" {
|
|
|
- industriesCond += ` AND cygx_industrial_article_group_management In (`+ activityTypes +`) `
|
|
|
+ industriesCond += ` AND sub_category_name In (`+ activityTypes +`) `
|
|
|
}
|
|
|
subjectNamesCond := ``
|
|
|
if subjectNames != "" {
|
|
|
- subjectNamesCond += ` AND cygx_industrial_article_group_subject In (`+ activityTypes +`) `
|
|
|
+ subjectNamesCond += ` AND sub_category_name In (`+ activityTypes +`) `
|
|
|
+ }
|
|
|
+
|
|
|
+ articleIntIds, err := models.GetCygxCygxArticleListByCondition(articleTypesCond, industriesCond, subjectNamesCond)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- //condition += " AND source = 'article' "
|
|
|
+ condition += ` OR (source = 'article' AND source_id IN (` + articleIntIds + `) `
|
|
|
//查询近一个月的数据
|
|
|
conditionInit = " AND publish_date > '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
|
|
|
if user.CompanyId <= 1 || totalRai == 0 {
|