|
@@ -1522,11 +1522,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 +1562,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 +1638,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 +1658,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)
|