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

Method BookScores

models/comments.go:212–217  ·  view source on GitHub ↗

获取评分内容

(p, listRows, bookId int)

Source from the content-addressed store, hash-verified

210
211//获取评分内容
212func (this *Score) BookScores(p, listRows, bookId int) (scores []BookScoresResult, err error) {
213 sql := `select s.score,s.time_create,m.avatar,m.nickname from md_score s left join md_members m on m.member_id=s.uid where s.book_id=? order by s.id desc limit %v offset %v`
214 sql = fmt.Sprintf(sql, listRows, (p-1)*listRows)
215 _, err = orm.NewOrm().Raw(sql, bookId).QueryRows(&scores)
216 return
217}
218
219//查询用户对文档的评分
220func (this *Score) BookScoreByUid(uid, bookId interface{}) int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected