Merge pull request 'by Robin at 20240316; alter account search expr' (#184) from BUG-20240316-0001-Robin into main

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/184
This commit is contained in:
chenhao 2024-03-16 23:56:34 +08:00
commit 4abf690044
3 changed files with 4 additions and 7 deletions

View File

@ -986,13 +986,8 @@ func (m *Mongo) GetAccountListFuzzilyByUserId(ctx *gin.Context, req *accountprot
},
},
{
"$expr": bson.M{
"$regexMatch": bson.M{
"input": bson.M{
"$toString": "$user_id",
},
"regex": fmt.Sprint(util.DerefInt64(req.UserId)),
},
"user_id_string": bson.M{
"$regex": fmt.Sprint(util.DerefInt64(req.UserId)),
},
},
},

View File

@ -68,6 +68,7 @@ func (s *Service) utilRegisterUser(ctx *gin.Context, req *loginproto.MobilePhone
return
}
account.UserId = goproto.Int64(userIdSeq.UserId)
account.UserIdString = goproto.String(fmt.Sprint(userIdSeq.UserId))
account.Name = goproto.String(fmt.Sprintf("用户%v", userIdSeq.UserId))
account.MobilePhone = goproto.String(req.MobilePhone)
account.RegionCode = goproto.String(req.RegionCode)

View File

@ -25,6 +25,7 @@ type Account struct {
DevType *int32 `bson:"dev_type"` // 注册来源
Latitude *float64 `bson:"latitude"` // 纬度
Longitude *float64 `bson:"longitude"` // 经度
UserIdString *string `bson:"user_id_string"` // string型user_id为模糊匹配设置
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记0-否1-是