|
@@ -79,7 +79,7 @@ func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error)
|
|
|
}
|
|
|
|
|
|
// HandleIndustryList预处理产业列表字段
|
|
|
-func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem) (items []*models.IndustrialManagement, err error) {
|
|
|
+func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem, resource string) (items []*models.IndustrialManagement, err error) {
|
|
|
userId := user.UserId
|
|
|
fllowList, err := models.GetUserFllowIndustrialList(userId)
|
|
|
if err != nil {
|
|
@@ -91,6 +91,20 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
fllowMap[v.IndustrialManagementId] = v.IndustrialManagementId
|
|
|
}
|
|
|
}
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ articleTypeIds, _ := GetYanXuanArticleTypeIds()
|
|
|
+ //给默认值
|
|
|
+ if resource != "Yx" {
|
|
|
+ resource = "Hz"
|
|
|
+ }
|
|
|
+ if articleTypeIds != "" {
|
|
|
+ if resource == "Yx" {
|
|
|
+ condition = ` AND a.article_type_id IN (` + articleTypeIds + `) `
|
|
|
+ } else {
|
|
|
+ condition = ` AND a.article_type_id NOT IN (` + articleTypeIds + `) `
|
|
|
+ }
|
|
|
+ }
|
|
|
mapindustrialId, e := GetMicroRoadshowVideoMap()
|
|
|
if e != nil {
|
|
|
err = e
|
|
@@ -124,7 +138,9 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
|
|
|
if len(industrialIdArr) > 0 {
|
|
|
//合并产业关联的标的
|
|
|
- listSubjcet, err = models.GetIndustrialSubjectAllByIndustrialId(industrialIdArr)
|
|
|
+ condition += ` AND m.industrial_management_id IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `)`
|
|
|
+ pars = append(pars, industrialIdArr)
|
|
|
+ listSubjcet, err = models.GetIndustrialSubjectAllByIndustrialId(pars, condition)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -165,18 +181,6 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //mapHistroyArticleId := make(map[int]int)
|
|
|
-
|
|
|
- //if userId > 0 {
|
|
|
- // listArticleHistory, e := models.GetUserToArticleHistory(userId, articleIdArr)
|
|
|
- // if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- // err = errors.New("获取产业关联的视频失败,GetindustryVideo " + e.Error())
|
|
|
- // return
|
|
|
- // }
|
|
|
- // for _, v := range listArticleHistory {
|
|
|
- // mapHistroyArticleId[v.ArticleId] = v.ArticleId
|
|
|
- // }
|
|
|
- //}
|
|
|
var industrialIds string
|
|
|
for _, id := range industrialIdArr {
|
|
|
industrialIds += strconv.Itoa(id) + ","
|