fix:修改查询用户的方法(改成支持用户名和真实姓名的模糊搜索),返回结果改成展示用户[姓名]的形式

pull/428/head
谢泽丰 2019-01-16 01:10:57 +08:00
parent 56225e892a
commit 55f15c438b
1 changed files with 3 additions and 2 deletions

View File

@ -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)
} }