Browse Source

no message

zhangchuanxing 6 months ago
parent
commit
474c7ec1b9
2 changed files with 27 additions and 1 deletions
  1. 1 1
      models/cygx/report_mapping_cygx.go
  2. 26 0
      services/cygx/acitvity.go

+ 1 - 1
models/cygx/report_mapping_cygx.go

@@ -36,7 +36,7 @@ type CygxReportMappingCygxAdd struct {
 // 列表
 func GetCygxReportMappingCygxList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxReportMappingCygx, err error) {
 	o := orm.NewOrmUsingDB("hz_cygx")
-	sql := `SELECT * FROM cygx_report_mapping_cygx as art WHERE 1= 1 `
+	sql := `SELECT * FROM   as art WHERE 1= 1 `
 	if condition != "" {
 		sql += condition
 	}

+ 26 - 0
services/cygx/acitvity.go

@@ -1183,6 +1183,32 @@ func DoActivityOnenIdWxTemplateMsg(activityId int) (err error) {
 		mapOpenidRefuset[v.UserId] = v.OpenId
 	}
 
+	if len(industrialList) > 0 {
+		var industrialIds []int
+		for _, v := range industrialList {
+			industrialIds = append(industrialIds, v.IndustrialManagementId)
+		}
+		var conditionFollow string
+		var parsFollow []interface{}
+		//根据产业关注ID,获取用户不感兴趣的产业信息
+		conditionFollow = " AND  industrial_management_id IN (" + utils.GetOrmInReplace(len(industrialIds)) + ")  AND follow_type = 3  "
+		parsFollow = append(parsFollow, industrialIds)
+		userFllowListUninterested, e := cygx.GetCygxIndustryFllowList(conditionFollow, parsFollow, 0, 0)
+		if e != nil {
+			err = errors.New("GetCygxIndustryFllowList, Err: " + e.Error())
+			return
+		}
+		var userFllowNum = make(map[int]int)
+		for _, v := range userFllowListUninterested {
+			userFllowNum[v.UserId]++
+			//如果活动对应的产业数量,跟用户不感兴趣的产业数量一致,就不做推送
+			if userFllowNum[v.UserId] == len(industrialList) {
+				mapOpenidRefuset[v.UserId] = "_"
+			}
+		}
+
+	}
+
 	var condition string
 
 	//如果活动选择了仅有决策人可见则做以下处理