From 2239fdf4e7f6d46e541161816596b28319c6bb0a Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Tue, 27 Aug 2024 14:44:07 +0800 Subject: [PATCH] fix: user search fields --- pkg/common/db/model/chat/attribute.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/common/db/model/chat/attribute.go b/pkg/common/db/model/chat/attribute.go index 81e56f71..9b83b2df 100644 --- a/pkg/common/db/model/chat/attribute.go +++ b/pkg/common/db/model/chat/attribute.go @@ -136,10 +136,10 @@ func (o *Attribute) SearchNormalUser(ctx context.Context, keyword string, forbid } if keyword != "" { filter["$or"] = []bson.M{ - //{"user_id": bson.M{"$regex": keyword, "$options": "i"}}, - //{"account": bson.M{"$regex": keyword, "$options": "i"}}, + {"user_id": bson.M{"$regex": keyword, "$options": "i"}}, + {"account": bson.M{"$regex": keyword, "$options": "i"}}, {"nickname": bson.M{"$regex": keyword, "$options": "i"}}, - //{"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, + {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, } } return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination)