go-project-example icon indicating copy to clipboard operation
go-project-example copied to clipboard

query_page_info.go中获取用户信息的uids取值似乎不太对吧

Open JuanJuanQingQuan opened this issue 2 years ago • 0 comments

下面这里uids,应该是topic以及post的userid字段而非主键ID吧

//获取用户信息
//	uids := []int64{f.topic.Id}
//	for _, post := range f.posts {
//		uids = append(uids, post.Id)
//	}
        uids := []int64{f.topic.UserId}

	for _, post := range f.posts {
		uids = append(uids, post.UserId)
	}
	userMap, err := repository.NewUserDaoInstance().MQueryUserById(uids)
	if err != nil {
		return err
	}
	f.userMap = userMap
	return nil

JuanJuanQingQuan avatar Oct 11 '23 02:10 JuanJuanQingQuan