Kaynağa Gözat

Merge branch 'feature/v1.2.36_ws' of BaseService/userCenter into feature/v1.2.36

wangshan 11 ay önce
ebeveyn
işleme
f97c4f1475
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      entity/subscribe.go

+ 3 - 2
entity/subscribe.go

@@ -270,12 +270,13 @@ func (this *UserInfoReq) EntnicheSub() *map[string]interface{} {
 				}
 			}
 		}
-		res, _ = this.Mgo.FindOne("entniche_rule", map[string]interface{}{
+		var ok bool
+		res, ok = this.Mgo.FindOne("entniche_rule", map[string]interface{}{
 			"i_deptid": deptId,
 			"i_entid":  this.EntId,
 		})
 		log.Println(res_, "+++")
-		if len(res_) > 0 {
+		if ok && res != nil && len(res_) > 0 {
 			oenitche, ok := (*res)["o_entniche"].(map[string]interface{})
 			if ok && oenitche != nil {
 				oenitche["a_buyerclass"] = res_["a_buyerclass"]