MCPcopy Create free account
hub / github.com/TruthHun/BookStack / HasRelatedBook

Method HasRelatedBook

models/relationship.go:186–193  ·  view source on GitHub ↗

HasRelatedBook 查询用户是否有相关联的书籍

(uid int)

Source from the content-addressed store, hash-verified

184
185// HasRelatedBook 查询用户是否有相关联的书籍
186func (m *Relationship) HasRelatedBook(uid int) bool {
187 err := orm.NewOrm().QueryTable(m).Filter("member_id", uid).One(m, "relationship_id")
188 if err != nil && err != orm.ErrNoRows {
189 beego.Error(err)
190 return false
191 }
192 return m.RelationshipId > 0
193}

Callers 1

PrepareMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected