|
@@ -1491,15 +1491,18 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
|
|
|
if (spqp.VipPower == 1 || spqp.MemberPower == 1) || (spqp.UserPower == 1 && spqp.PowerSource == 0) {
|
|
|
//1、mysql entniche_user_rule表中获取自己的分发规则id
|
|
|
data := IC.MainMysql.SelectBySql(`select rule_id from entniche_user_rule where user_id =? and dept_id =?`, spqp.EntUserId, spqp.DeptId)
|
|
|
- if data == nil && len(*data) == 0 {
|
|
|
- MapToarr(keyData, s.ModuleFlag)
|
|
|
+ if data == nil || len(*data) == 0 {
|
|
|
+ return MapToarr(keyData, s.ModuleFlag)
|
|
|
}
|
|
|
ruleId := common.ObjToString((*data)[0]["rule_id"])
|
|
|
//3、entniche_distribute表,查询条件:{_id:ObjectId(1结果中的分发规则id),i_status:0},取 o_entniche.a_items,这个查到的是分类名称,然后到上面1的结果中获取这个分类下的词
|
|
|
res, _ := IC.Mgo.FindById("entniche_distribute", ruleId, nil)
|
|
|
+ if res == nil || len(*res) == 0 {
|
|
|
+ return MapToarr(keyData, s.ModuleFlag)
|
|
|
+ }
|
|
|
entItem := (*res)["a_items"].([]interface{})
|
|
|
if (*res)["a_items"] == nil {
|
|
|
- MapToarr(keyData, s.ModuleFlag)
|
|
|
+ return MapToarr(keyData, s.ModuleFlag)
|
|
|
}
|
|
|
|
|
|
//2、entniche_rule表, 企业订阅关键词查询条件: {i_entid:123,i_deptid:0},取 o_entniche.a_items
|