We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
根据follower表:
func (*FollowDao) GetFollowingIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("follower_id = ?", userId). Pluck("user_id", &ids).Error; nil != err { // 没有关注任何人,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
func (*FollowDao) GetFollowersIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("user_id = ?", userId). Where("cancel = ?", 0). Pluck("follower_id", &ids).Error; nil != err { // 没有粉丝,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
The text was updated successfully, but these errors were encountered:
你理解反了
Sorry, something went wrong.
No branches or pull requests
根据follower表:
而在followDao中,获取关注列表函数:
func (*FollowDao) GetFollowingIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("follower_id = ?", userId). Pluck("user_id", &ids).Error; nil != err { // 没有关注任何人,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
func (*FollowDao) GetFollowersIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("user_id = ?", userId). Where("cancel = ?", 0). Pluck("follower_id", &ids).Error; nil != err { // 没有粉丝,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
The text was updated successfully, but these errors were encountered: