|
@@ -172,6 +172,7 @@ type ArticleDetail struct {
|
|
IsRoadShow bool `description:"是否是路演精华"`
|
|
IsRoadShow bool `description:"是否是路演精华"`
|
|
ReportType int `description:"报告类型,1行业报告,2产业报告,0无"`
|
|
ReportType int `description:"报告类型,1行业报告,2产业报告,0无"`
|
|
FieldName string `description:"策略平台的领域字段名称"`
|
|
FieldName string `description:"策略平台的领域字段名称"`
|
|
|
|
+ TypeName string `description:"策略平台类型字段名称"`
|
|
}
|
|
}
|
|
|
|
|
|
type ArticleDetailFileLink struct {
|
|
type ArticleDetailFileLink struct {
|
|
@@ -798,7 +799,6 @@ func GetCygxCygxArticleListByCondition(articleTypesCond, activityTypesCond, indu
|
|
err = o.Raw(artSql).QueryRow(&artIds)
|
|
err = o.Raw(artSql).QueryRow(&artIds)
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
actSql += ` WHERE 1=1 `
|
|
actSql += ` WHERE 1=1 `
|
|
if activityTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if activityTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
@@ -816,7 +816,7 @@ func GetCygxCygxArticleListByCondition(articleTypesCond, activityTypesCond, indu
|
|
if strings.Contains(articleTypeStr, "晨会精华") {
|
|
if strings.Contains(articleTypeStr, "晨会精华") {
|
|
mmSql += ` WHERE 1=1 `
|
|
mmSql += ` WHERE 1=1 `
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
- mmSql += ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
|
|
|
+ mmSql += ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
} else if industryStr == "" && subjectNameStr != "" {
|
|
} else if industryStr == "" && subjectNameStr != "" {
|
|
mmSql += ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
mmSql += ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
} else if industryStr != "" && subjectNameStr == "" {
|
|
} else if industryStr != "" && subjectNameStr == "" {
|
|
@@ -828,8 +828,6 @@ func GetCygxCygxArticleListByCondition(articleTypesCond, activityTypesCond, indu
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 单个tag时用,取合集
|
|
// 单个tag时用,取合集
|
|
func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityTypesCondSlice, industriesCondSlice, subjectNamesSlice, articleTypeSlice []string) (artIds, actIds, mmIds string, err error) {
|
|
func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityTypesCondSlice, industriesCondSlice, subjectNamesSlice, articleTypeSlice []string) (artIds, actIds, mmIds string, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
@@ -840,7 +838,7 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
mmSql := ` SELECT GROUP_CONCAT(DISTINCT mmc.id SEPARATOR ',') AS mm_ids FROM cygx_morning_meeting_review_chapter as mmc `
|
|
mmSql := ` SELECT GROUP_CONCAT(DISTINCT mmc.id SEPARATOR ',') AS mm_ids FROM cygx_morning_meeting_review_chapter as mmc `
|
|
|
|
|
|
for _, s := range industriesCondSlice {
|
|
for _, s := range industriesCondSlice {
|
|
- if s != ""{
|
|
|
|
|
|
+ if s != "" {
|
|
artSql += ` INNER JOIN cygx_industrial_article_group_management AS iam ON iam.article_id = art.article_id
|
|
artSql += ` INNER JOIN cygx_industrial_article_group_management AS iam ON iam.article_id = art.article_id
|
|
INNER JOIN cygx_industrial_management AS im ON im.industrial_management_id=iam.industrial_management_id `
|
|
INNER JOIN cygx_industrial_management AS im ON im.industrial_management_id=iam.industrial_management_id `
|
|
actSql += ` INNER JOIN cygx_industrial_activity_group_management AS iam ON iam.activity_id = act.activity_id
|
|
actSql += ` INNER JOIN cygx_industrial_activity_group_management AS iam ON iam.activity_id = act.activity_id
|
|
@@ -852,7 +850,7 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for _, s := range subjectNamesSlice {
|
|
for _, s := range subjectNamesSlice {
|
|
- if s != ""{
|
|
|
|
|
|
+ if s != "" {
|
|
artSql += ` INNER JOIN cygx_industrial_article_group_subject AS ias ON ias.article_id = art.article_id
|
|
artSql += ` INNER JOIN cygx_industrial_article_group_subject AS ias ON ias.article_id = art.article_id
|
|
INNER JOIN cygx_industrial_subject AS cis ON cis.industrial_subject_id=ias.industrial_subject_id `
|
|
INNER JOIN cygx_industrial_subject AS cis ON cis.industrial_subject_id=ias.industrial_subject_id `
|
|
actSql += ` INNER JOIN cygx_industrial_activity_group_subject AS ias ON ias.activity_id = act.activity_id
|
|
actSql += ` INNER JOIN cygx_industrial_activity_group_subject AS ias ON ias.activity_id = act.activity_id
|
|
@@ -874,7 +872,6 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
subjectNameStr := subjectNamesSlice[i]
|
|
subjectNameStr := subjectNamesSlice[i]
|
|
articleTypeStr := articleTypeSlice[i]
|
|
articleTypeStr := articleTypeSlice[i]
|
|
|
|
|
|
-
|
|
|
|
if articleTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if articleTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
artSql += articleTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
artSql += articleTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
@@ -886,7 +883,7 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
artSql += articleTypesCond
|
|
artSql += articleTypesCond
|
|
}
|
|
}
|
|
|
|
|
|
- if i == len(articleTypeCondSlice) -1 {
|
|
|
|
|
|
+ if i == len(articleTypeCondSlice)-1 {
|
|
artSql += `)) `
|
|
artSql += `)) `
|
|
} else {
|
|
} else {
|
|
artSql += `) OR (1=1 `
|
|
artSql += `) OR (1=1 `
|
|
@@ -895,8 +892,6 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
isNeedArt = true
|
|
isNeedArt = true
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
if activityTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if activityTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
actSql += activityTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
actSql += activityTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
@@ -908,7 +903,7 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
actSql += activityTypesCond
|
|
actSql += activityTypesCond
|
|
}
|
|
}
|
|
|
|
|
|
- if i == len(articleTypeCondSlice) -1 {
|
|
|
|
|
|
+ if i == len(articleTypeCondSlice)-1 {
|
|
actSql += `)) `
|
|
actSql += `)) `
|
|
} else {
|
|
} else {
|
|
actSql += `) OR (1=1 `
|
|
actSql += `) OR (1=1 `
|
|
@@ -919,14 +914,14 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
|
|
|
|
if strings.Contains(articleTypeStr, "晨会精华") {
|
|
if strings.Contains(articleTypeStr, "晨会精华") {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
if industryStr != "" && subjectNameStr != "" {
|
|
- mmSql += ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
|
|
|
+ mmSql += ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
} else if industryStr == "" && subjectNameStr != "" {
|
|
} else if industryStr == "" && subjectNameStr != "" {
|
|
mmSql += ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
mmSql += ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
} else if industryStr != "" && subjectNameStr == "" {
|
|
} else if industryStr != "" && subjectNameStr == "" {
|
|
mmSql += ` AND im.industry_name In (` + industryStr + `) `
|
|
mmSql += ` AND im.industry_name In (` + industryStr + `) `
|
|
}
|
|
}
|
|
|
|
|
|
- if i == len(articleTypeCondSlice) -1 {
|
|
|
|
|
|
+ if i == len(articleTypeCondSlice)-1 {
|
|
mmSql += `)) `
|
|
mmSql += `)) `
|
|
} else {
|
|
} else {
|
|
mmSql += `) OR (1=1 `
|
|
mmSql += `) OR (1=1 `
|
|
@@ -938,23 +933,22 @@ func GetCygxCygxArticleListByConditionSoloTag(articleTypeCondSlice, activityType
|
|
|
|
|
|
if isNeedArt {
|
|
if isNeedArt {
|
|
err = o.Raw(artSql).QueryRow(&artIds)
|
|
err = o.Raw(artSql).QueryRow(&artIds)
|
|
- if err != nil{
|
|
|
|
|
|
+ if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if isNeedAct{
|
|
|
|
|
|
+ if isNeedAct {
|
|
err = o.Raw(actSql).QueryRow(&actIds)
|
|
err = o.Raw(actSql).QueryRow(&actIds)
|
|
- if err != nil{
|
|
|
|
|
|
+ if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if isNeedMm {
|
|
if isNeedMm {
|
|
err = o.Raw(mmSql).QueryRow(&mmIds)
|
|
err = o.Raw(mmSql).QueryRow(&mmIds)
|
|
- if err != nil{
|
|
|
|
|
|
+ if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|