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

Method List

models/read_record.go:244–254  ·  view source on GitHub ↗

查询阅读记录

(uid, bookId int)

Source from the content-addressed store, hash-verified

242
243//查询阅读记录
244func (this *ReadRecord) List(uid, bookId int) (lists []RecordList, cnt int64, err error) {
245 if uid*bookId == 0 {
246 err = errors.New("用户id和书籍id不能为空")
247 return
248 }
249 fields := "r.doc_id,r.create_at,d.document_name title,d.identify"
250 sql := "select %v from %v r left join md_documents d on r.doc_id=d.document_id where r.book_id=? and r.uid=? order by r.id desc limit 5000"
251 sql = fmt.Sprintf(sql, fields, tableReadRecord)
252 cnt, err = orm.NewOrm().Raw(sql, bookId, uid).QueryRows(&lists)
253 return
254}
255
256//查询阅读进度
257func (this *ReadRecord) Progress(uid, bookId int) (rp ReadProgress, err error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected