diff --git a/modules/friend/api_cross_addblack.go b/modules/friend/api_cross_addblack.go index f77ec927f..96d4e22ad 100644 --- a/modules/friend/api_cross_addblack.go +++ b/modules/friend/api_cross_addblack.go @@ -115,7 +115,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR target.Beblackids = append(target.Beblackids, session.GetUserId()) //更新 err = this.module.modelFriend.Change(target.Uid, map[string]interface{}{ - "beblackids": self.Beblackids, + "beblackids": target.Beblackids, }) if err != nil { errdata = &pb.ErrorData{ diff --git a/modules/friend/model_friend.go b/modules/friend/model_friend.go index f12b1c7cd..0ea7cecdf 100644 --- a/modules/friend/model_friend.go +++ b/modules/friend/model_friend.go @@ -54,6 +54,7 @@ func (this *ModelFriend) GetFriend(uid string) (info *pb.DBFriend, err error) { BlackIds: make([]string, 0), GetZandIds: make([]string, 0), Record: make([]*pb.AssistRecord, 0), + Beblackids: make([]string, 0), } err = this.Add(uid, info) } @@ -81,6 +82,7 @@ func (this *ModelFriend) GetFriends(uids []string) (friends []*pb.DBFriend, err BlackIds: make([]string, 0), GetZandIds: make([]string, 0), Record: make([]*pb.AssistRecord, 0), + Beblackids: make([]string, 0), } err = this.Add(v, info) friends = append(friends, info)