xingzai 2 сар өмнө
parent
commit
7b69429f6a

+ 4 - 1
services/industrial_subject.go

@@ -68,7 +68,7 @@ func GetArticleGroupSubjectMapByIndustrialManagementId(articleIds []int, industr
 
 	var condition string
 	var pars []interface{}
-	condition += `  article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `) `
+	condition += ` AND  article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `) `
 	pars = append(pars, articleIds)
 	articleList, e := models.GetArticleList(condition, pars)
 	if e != nil {
@@ -83,6 +83,9 @@ func GetArticleGroupSubjectMapByIndustrialManagementId(articleIds []int, industr
 			sliceKuohao := strings.Split(vSubject, "(")           //过滤括号
 			sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
 			subject := sliceXiahuaxian[0]
+			if mapSubject[subject] == 0 {
+				continue
+			}
 			item := models.CygxIndustrialSubject{
 				IndustrialSubjectId:    mapSubject[subject],
 				IndustrialManagementId: industrialManagementId,