MCPcopy Index your code
hub / github.com/TruthHun/BookStack / GetFansList

Method GetFansList

models/fans.go:57–68  ·  view source on GitHub ↗

查询用户的粉丝(用户id作为被关注对象)

(uid, page, pageSize int)

Source from the content-addressed store, hash-verified

55
56//查询用户的粉丝(用户id作为被关注对象)
57func (this *Fans) GetFansList(uid, page, pageSize int) (fans []FansResult, total int64, err error) {
58 o := orm.NewOrm()
59 total, _ = o.QueryTable(tableFans).Filter("uid", uid).Count()
60 if total > 0 {
61 sql := fmt.Sprintf(
62 "select m.member_id uid,m.avatar,m.account,m.nickname from md_members m left join md_fans f on m.member_id=f.fans_id where f.uid=? order by f.id desc limit %v offset %v",
63 pageSize, (page-1)*pageSize,
64 )
65 _, err = o.Raw(sql, uid).QueryRows(&fans)
66 }
67 return
68}
69
70//查询用户的关注(用户id作为fans_id)
71func (this *Fans) GetFollowList(fansId, page, pageSize int) (fans []FansResult, total int64, err error) {

Callers 2

FansMethod · 0.80
getFansOrFollowMethod · 0.80

Calls 1

CountMethod · 0.45

Tested by

no test coverage detected