mirror of https://github.com/mindoc-org/mindoc.git
fix:修改查询用户的方法(改成支持用户名和真实姓名的模糊搜索),返回结果改成展示用户[姓名]的形式
parent
56225e892a
commit
55f15c438b
|
@ -98,7 +98,8 @@ func (c *SearchController) User() {
|
||||||
c.JsonResult(500, "项目不存在")
|
c.JsonResult(500, "项目不存在")
|
||||||
}
|
}
|
||||||
|
|
||||||
members, err := models.NewMemberRelationshipResult().FindNotJoinUsersByAccount(book.BookId, 10, "%"+keyword+"%")
|
//members, err := models.NewMemberRelationshipResult().FindNotJoinUsersByAccount(book.BookId, 10, "%"+keyword+"%")
|
||||||
|
members, err := models.NewMemberRelationshipResult().FindNotJoinUsersByAccountOrRealName(book.BookId, 10, "%"+keyword+"%")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beego.Error("查询用户列表出错:" + err.Error())
|
beego.Error("查询用户列表出错:" + err.Error())
|
||||||
c.JsonResult(500, err.Error())
|
c.JsonResult(500, err.Error())
|
||||||
|
@ -109,7 +110,7 @@ func (c *SearchController) User() {
|
||||||
for _, member := range members {
|
for _, member := range members {
|
||||||
item := models.KeyValueItem{}
|
item := models.KeyValueItem{}
|
||||||
item.Id = member.MemberId
|
item.Id = member.MemberId
|
||||||
item.Text = member.Account
|
item.Text = member.Account + "[" + member.RealName + "]"
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue