浏览代码

Merge branch 'feature/v1.1.9' of http://192.168.3.207:8080/BaseService/jyMicroservices into feature/v1.1.9

wangshan 2 年之前
父节点
当前提交
df2035ed14
共有 1 个文件被更改,包括 22 次插入22 次删除
  1. 22 22
      jyBXSubscribe/rpc/model/push.go

+ 22 - 22
jyBXSubscribe/rpc/model/push.go

@@ -366,22 +366,10 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 		if spqp.IsEnt {
 			if spqp.BuySubject == 1 {
 				//企业主体是企业的企业查询
-				if spqp.UserType == SubVipFlag {
-					userStr = fmt.Sprintf("   a.entid='%s' and (a.source > 1) and (a.product=1) ", spqp.EntId)
-
-				} else if spqp.UserType == MemberFlag {
-					userStr = fmt.Sprintf("   a.entid='%s' and (a.source>1) and (a.product=2) ", spqp.EntId)
-
-				} else {
-					userStr = fmt.Sprintf("   a.entid='%s' and (a.source>1) and (a.product<1) ", spqp.EntId)
-				}
+				userStr = fmt.Sprintf("   a.entid='%s' and (a.source > 1) ", spqp.EntId)
 			} else {
 				//企业主体是个人的企业查询
-				if s.ModuleFlag == EntnicheFlag {
-					userStr = fmt.Sprintf("   a.entid='%s'  and a.product < 1", spqp.EntId)
-				} else {
-					userStr = fmt.Sprintf("   a.entid='%s'", spqp.EntId)
-				}
+				userStr = fmt.Sprintf("   a.entid='%s' ", spqp.EntId)
 			}
 		} else {
 			if spqp.BuySubject == 1 {
@@ -1522,11 +1510,13 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
 			if (*res)["a_items"] == nil {
 				return MapToarr(keyData)
 			}
-
 			//2、entniche_rule表, 企业订阅关键词查询条件:  {i_entid:123,i_deptid:0},取 o_entniche.a_items
 			res_, _ := IC.Mgo.FindOneByField("entniche_rule", map[string]interface{}{
-				"i_deptid": map[string]interface{}{"$exists": 0},
-				"i_entid":  common.Int64All(spqp.EntId),
+				"i_deptid": map[string]interface{}{"$exists": false},
+				"i_userid": map[string]interface{}{
+					"$exists": false,
+				},
+				"i_entid": common.Int64All(spqp.EntId),
 			}, `{"o_entniche":1}`)
 			o_entniche := &map[string]interface{}{}
 			if res_ != nil {
@@ -1560,8 +1550,11 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
 	} else {
 		//企业关键词查找
 		res_, _ := IC.Mgo.FindOneByField("entniche_rule", map[string]interface{}{
-			"i_deptid": map[string]interface{}{"$exists": 0},
-			"i_entid":  common.Int64All(spqp.EntId),
+			"i_deptid": map[string]interface{}{"$exists": false},
+			"i_userid": map[string]interface{}{
+				"$exists": false,
+			},
+			"i_entid": common.Int64All(spqp.EntId),
 		}, `{"o_entniche":1}`)
 		o_entniche := &map[string]interface{}{}
 		if res_ != nil {
@@ -1633,13 +1626,18 @@ func MergeArray(dest []interface{}, src []interface{}) (result []interface{}) {
 		if v["notkey"] != nil {
 			otkeyArr := common.ObjArrToStringArr(v["notkey"].([]interface{}))
 			for _, keyV := range otkeyArr {
-				notkey += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				if common.InterfaceToStr(keyV) != "" {
+					notkey += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				}
+
 			}
 		}
 		if v["key"] != nil {
 			keyArr := common.ObjArrToStringArr(v["key"].([]interface{}))
 			for _, keyV := range keyArr {
-				key += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				if common.InterfaceToStr(keyV) != "" {
+					key += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				}
 			}
 		}
 		if v["matchway"] != nil {
@@ -1648,7 +1646,9 @@ func MergeArray(dest []interface{}, src []interface{}) (result []interface{}) {
 		if v["appendkey"] != nil {
 			appendkeyArr := common.ObjArrToStringArr(v["appendkey"].([]interface{}))
 			for _, keyV := range appendkeyArr {
-				appendkey += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				if common.InterfaceToStr(keyV) != "" {
+					appendkey += fmt.Sprintf(",%s", common.InterfaceToStr(keyV))
+				}
 			}
 		}
 		k := fmt.Sprintf("%s_____%s_____%s_____%s", notkey, key, matchway, appendkey)