From 8ad0d55dcb0598210c79bdab7178f8d385075f11 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 19 Jan 2024 22:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/friend/api_cross_getassist.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/friend/api_cross_getassist.go b/modules/friend/api_cross_getassist.go index 95b10674f..2c284c6f7 100644 --- a/modules/friend/api_cross_getassist.go +++ b/modules/friend/api_cross_getassist.go @@ -50,16 +50,16 @@ func (this *apiComp) GetAssistHero(session comm.IUserSession, req *pb.FriendGetA leftCount = int32(comm.AssistHeroCount - len(list.Data)) // localNum, _ := this.module.modelFriend.DB.CountDocuments(core.SqlTable(this.module.modelFriend.TableName), bson.M{}) // randomIndex := comm.GetRandNum(0, int32(localNum)) - cur, err := this.module.modelFriend.DB.Find(core.SqlTable(this.module.modelFriend.TableName), bson.M{"assistHeroId": bson.M{"$ne": ""}}, options.Find().SetSkip(int64(0)).SetLimit(int64(leftCount))) //.skip(1).limit(1) - for cur.Next(context.TODO()) { - tmp := &pb.DBFriend{} - if err = cur.Decode(tmp); err == nil { - if session.GetUserId() != tmp.Uid { - list.Data[tmp.Uid] = tmp.Info.Name - heros = append(heros, tmp.Hero) - } - } - } + // cur, err := this.module.modelFriend.DB.Find(core.SqlTable(this.module.modelFriend.TableName), bson.M{"assistHeroId": bson.M{"$ne": ""}}, options.Find().SetSkip(int64(0)).SetLimit(int64(leftCount))) //.skip(1).limit(1) + // for cur.Next(context.TODO()) { + // tmp := &pb.DBFriend{} + // if err = cur.Decode(tmp); err == nil { + // if session.GetUserId() != tmp.Uid { + // list.Data[tmp.Uid] = tmp.Info.Name + // heros = append(heros, tmp.Hero) + // } + // } + // } err = this.module.modelAssist.Add(session.GetUserId(), list) session.SendMsg(string(this.module.GetType()), "getassisthero", &pb.FriendGetAssistHeroResp{