|
@@ -346,29 +346,33 @@ func GetCygxCygxArticleListByCondition(articleTypesCond, activityTypesCond, indu
|
|
|
INNER JOIN cygx_industrial_subject AS cis ON cis.industrial_subject_id=ias.industrial_subject_id `
|
|
|
}
|
|
|
artSql += ` WHERE 1=1 `
|
|
|
-
|
|
|
- if industryStr != "" && subjectNameStr != "" {
|
|
|
- artSql += articleTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
- } else if industryStr == "" && subjectNameStr != "" {
|
|
|
- artSql += articleTypesCond + ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
|
- } else if industryStr != "" && subjectNameStr == "" {
|
|
|
- artSql += articleTypesCond + ` AND im.industry_name In (` + industryStr + `) `
|
|
|
- } else {
|
|
|
- artSql += articleTypesCond
|
|
|
+ if articleTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
|
+ if industryStr != "" && subjectNameStr != "" {
|
|
|
+ artSql += articleTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
+ } else if industryStr == "" && subjectNameStr != "" {
|
|
|
+ artSql += articleTypesCond + ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
|
+ } else if industryStr != "" && subjectNameStr == "" {
|
|
|
+ artSql += articleTypesCond + ` AND im.industry_name In (` + industryStr + `) `
|
|
|
+ } else {
|
|
|
+ artSql += articleTypesCond
|
|
|
+ }
|
|
|
+ err = o.Raw(artSql).QueryRow(&artIds)
|
|
|
}
|
|
|
- err = o.Raw(artSql).QueryRow(&artIds)
|
|
|
+
|
|
|
|
|
|
actSql += ` WHERE 1=1 `
|
|
|
- if industryStr != "" && subjectNameStr != "" {
|
|
|
- actSql += activityTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
- } else if industryStr == "" && subjectNameStr != "" {
|
|
|
- actSql += activityTypesCond + ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
|
- } else if industryStr != "" && subjectNameStr == "" {
|
|
|
- actSql += activityTypesCond + ` AND im.industry_name In (` + industryStr + `) `
|
|
|
- } else {
|
|
|
- actSql += activityTypesCond
|
|
|
+ if activityTypesCond != "" || (articleTypesCond == "" && activityTypesCond == "") {
|
|
|
+ if industryStr != "" && subjectNameStr != "" {
|
|
|
+ actSql += activityTypesCond + ` AND (im.industry_name In (` + industryStr + `) OR cis.subject_name In (` + subjectNameStr + `) )`
|
|
|
+ } else if industryStr == "" && subjectNameStr != "" {
|
|
|
+ actSql += activityTypesCond + ` AND cis.subject_name In (` + subjectNameStr + `) `
|
|
|
+ } else if industryStr != "" && subjectNameStr == "" {
|
|
|
+ actSql += activityTypesCond + ` AND im.industry_name In (` + industryStr + `) `
|
|
|
+ } else {
|
|
|
+ actSql += activityTypesCond
|
|
|
+ }
|
|
|
+ err = o.Raw(actSql).QueryRow(&actIds)
|
|
|
}
|
|
|
- err = o.Raw(actSql).QueryRow(&actIds)
|
|
|
|
|
|
return
|
|
|
}
|